Adds UI to enrole members

This commit is contained in:
2015-11-04 16:20:21 +01:00
parent bc6feacbee
commit 0b8b717f3e
12 changed files with 58 additions and 11 deletions

View File

@ -1,3 +1,14 @@
2015-11-04 Paul Schneider <paul@pschneider.fr>
* Web.csproj:
* AppAdmin.master:
* AddRole.aspx:
* OAuth2.cs:
* RoleList.aspx:
* UsersInRole.aspx:
* AdminController.cs:
* AddMemberToRole.ascx:
2015-11-04 Paul Schneider <paul@pschneider.fr>
* instdbws.sql:

View File

@ -24,12 +24,11 @@ namespace Yavsc.Controllers
/// </summary>
public ActionResult Index()
{
// FIXME do this in a new installation script.
if (!Roles.RoleExists (roleName)) {
Roles.CreateRole (roleName);
YavscHelpers.Notify (ViewData, roleName + " " + LocalizedText.role_created);
}
return View ();
}
/// <summary>

View File

@ -76,7 +76,7 @@ namespace Yavsc.Helpers.Google
{
string scope = string.Join ("%20", scopeOpenid);
string prms = String.Format ("response_type=code&client_id={0}&redirect_uri={1}&scope={2}&state={3}&include_granted_scopes=false",
string prms = String.Format ("response_type=code&client_id={0}&redirect_uri={1}&scope={2}&state={3}&include_granted_scopes=false&approval_prompt=force",
CLIENT_ID, RedirectUri, scope, state);
GetAuthResponse (bresp, prms);
}

View File

@ -58,6 +58,7 @@ else {%> Yavsc.notice(<%=note.body%>, <%=note.click_action%>); <% } %>
<li><%= Html.ActionLink("Restaurations", "Restore") %></li>
<li><%= Html.ActionLink("Create backup","CreateBackup") %></li>
<li><%= Html.ActionLink("Remove user", "RemoveUser") %></li>
<li><%= Html.ActionLink("Add a Role ", "AddRole") %></li>
<li><%= Html.ActionLink("Remove role", "RemoveRoleQuery") %></li>
<li><%= Html.ActionLink("User list", "UserList") %></li>
<li><%= Html.ActionLink("Role list", "RoleList") %></li>

View File

@ -0,0 +1,11 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%= Html.ValidationSummary() %>
<% using(Ajax.BeginForm())
{ %>
Nom du rôle :
<%= Html.TextBox( "RoleName" ) %>
<%= Html.ValidationMessage("RoleName", "*") %><br/>
<input class="actionlink" type="submit"/>
<% } %>

View File

@ -9,6 +9,7 @@ Nom du rôle :
<%= Html.ValidationMessage("RoleName", "*") %><br/>
<input class="actionlink" type="submit"/>
<% } %>
<%= Html.Partial("AddMemberToRole")%>
</asp:Content>

View File

@ -4,7 +4,7 @@ Roles:
<ul>
<%foreach (string rolename in (string[]) Model){ %>
<li><%=rolename%> <% if (Roles.IsUserInRole("Admin")) { %>
<li><%=Html.ActionLink(rolename,"UsersInRole", new { rolename = rolename }, new { @class="actionlink" } )%> <% if (Roles.IsUserInRole("Admin")) { %>
<%= Html.ActionLink("Supprimer","RemoveRole", new { rolename = rolename }, new { @class="actionlink" } ) %>
<% } %></li>
<% } %>

View File

@ -0,0 +1,11 @@
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
</head>
<body>
<div>
</div>
</body>

View File

@ -252,7 +252,6 @@
<Content Include="Views\Admin\Backups.aspx" />
<Content Include="Views\Admin\Restore.aspx" />
<Content Include="Views\Admin\Restored.aspx" />
<Content Include="Views\Admin\Index.aspx" />
<Content Include="Views\FrontOffice\Estimates.aspx" />
<Content Include="Catalog.xml" />
<Content Include="RegistrationMail.txt" />
@ -469,6 +468,9 @@
<Content Include="App_Themes\images\star-939235_1280.jpg" />
<Content Include="App_Themes\images\star-939235_1280.s.jpg" />
<Content Include="App_Themes\images\star-939235_1280.xxs.jpg" />
<Content Include="Views\Admin\AddMemberToRole.ascx" />
<Content Include="Views\Admin\UsersInRole.aspx" />
<Content Include="Views\Admin\Index.aspx" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />