diff options
| author | Michael <[email protected]> | 2017-03-20 16:45:17 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-03-20 16:45:17 -0400 |
| commit | cdc61eb4ea5309769ad4db84d92594e4dc3dff67 (patch) | |
| tree | a8297a7aecc4376f07a497a5e02ab5ff165bfbd3 /Project-Unite/Views/Admin/AccessControl.cshtml | |
| parent | d9f475e1f33bbf39ca0d79d7a6b0c2fd501b4f2d (diff) | |
| download | project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.tar.gz project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.tar.bz2 project-unite-cdc61eb4ea5309769ad4db84d92594e4dc3dff67.zip | |
Initial commit (azure deploy test)
Diffstat (limited to 'Project-Unite/Views/Admin/AccessControl.cshtml')
| -rw-r--r-- | Project-Unite/Views/Admin/AccessControl.cshtml | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Project-Unite/Views/Admin/AccessControl.cshtml b/Project-Unite/Views/Admin/AccessControl.cshtml new file mode 100644 index 0000000..8d51d54 --- /dev/null +++ b/Project-Unite/Views/Admin/AccessControl.cshtml @@ -0,0 +1,59 @@ +@model Project_Unite.Models.AdminAccessControlViewModel + + +@{ + ViewBag.Title = "Access control"; + + Dictionary<string, string> EnumNames = new Dictionary<string, string> { + { "None", "No permissions" }, + { "CanRead", "Read only" }, + { "CanPost", "Can post new topics" }, + {"CanReply", "Can reply" } + }; + + var availablePermissions = new List<SelectListItem>(); + foreach (var v in Enum.GetValues(typeof(Project_Unite.Models.PermissionPreset))) + { + availablePermissions.Add(new SelectListItem + { + Value = v.ToString(), + Text = EnumNames[v.ToString()] + }); + } + +} + +<h2>Access control</h2> + +<p>Below, you can modify the access control list (ACL) definitions for all forum categories.</p> + + @foreach (var key in Model.IDs) + { + <h4>@key</h4> + <table class="table"> + <tr> + <th>Role ID</th> + <th>Value</th> + </tr> + @foreach (var p in Model.ACLList.Where(x => x.CategoryId == key)) + { + <tr> + <td>@Html.DisplayFor(v => p.RoleId)</td> + <td> + @foreach(var r in EnumNames) + { + if(r.Key == p.Permissions.ToString()) + { + <a href="#" class="btn btn-primary">@r.Value</a> + } + else + { + @Html.ActionLink(r.Value, "SetPermission", "Admin", new { id=p.CategoryId, role=p.RoleId, permission=r.Key}, new { @class = "btn btn-default" }) + } + } + </td> + </tr> + } + </table> + + }
\ No newline at end of file |
