summaryrefslogtreecommitdiff
path: root/Project-Unite/Views/Shared/_PostModerationBar.cshtml
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-20 16:45:17 -0400
committerMichael <[email protected]>2017-03-20 16:45:17 -0400
commitcdc61eb4ea5309769ad4db84d92594e4dc3dff67 (patch)
treea8297a7aecc4376f07a497a5e02ab5ff165bfbd3 /Project-Unite/Views/Shared/_PostModerationBar.cshtml
parentd9f475e1f33bbf39ca0d79d7a6b0c2fd501b4f2d (diff)
downloadproject-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.tar.gz
project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.tar.bz2
project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.zip
Initial commit (azure deploy test)
Diffstat (limited to 'Project-Unite/Views/Shared/_PostModerationBar.cshtml')
-rw-r--r--Project-Unite/Views/Shared/_PostModerationBar.cshtml27
1 files changed, 27 insertions, 0 deletions
diff --git a/Project-Unite/Views/Shared/_PostModerationBar.cshtml b/Project-Unite/Views/Shared/_PostModerationBar.cshtml
new file mode 100644
index 0000000..a647447
--- /dev/null
+++ b/Project-Unite/Views/Shared/_PostModerationBar.cshtml
@@ -0,0 +1,27 @@
+@using Microsoft.AspNet.Identity
+@model Project_Unite.Models.ForumPost
+
+@{
+ string acl_perm_delete = "CanDeletePosts";
+ string acl_perm_edit = "CanEditPosts";
+
+ if (User.Identity.GetUserId() == Model.AuthorId)
+ {
+ acl_perm_delete = "CanDeleteOwnPosts";
+ acl_perm_edit = "CanEditOwnPosts";
+ }
+}
+
+<ul class="nav nav-tabs">
+ @if(ACL.Granted(User.Identity.Name, acl_perm_edit))
+ {
+ <li><a href="@Url.Action("EditPost", "Forum", new { id = Model.Id })"><span class="glyphicon glyphicon-pencil"></span> Edit</a></li>
+ }
+ @if (ACL.Granted(User.Identity.Name, acl_perm_delete))
+ {
+ <li><a href="@Url.Action("DeletePost", "Forum", new { id = Model.Id })"><span class="glyphicon glyphicon-trash"></span> Delete</a></li>
+ }
+
+</ul>
+
+<hr/> \ No newline at end of file