mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Renaming FeaturePermissions to RoleCategoryPermissions
--HG-- branch : dev
This commit is contained in:
@@ -102,11 +102,11 @@ namespace Orchard.Roles.Controllers {
|
||||
throw new HttpException(404, "page with id " + id + " was not found");
|
||||
}
|
||||
var model = new RoleEditViewModel { Name = role.Name, Id = role.Id,
|
||||
FeaturePermissions = _roleService.GetInstalledPermissions(),
|
||||
RoleCategoryPermissions = _roleService.GetInstalledPermissions(),
|
||||
CurrentPermissions = _roleService.GetPermissionsForRole(id)};
|
||||
|
||||
var simulation = UserSimulation.Create(role.Name);
|
||||
model.EffectivePermissions = model.FeaturePermissions
|
||||
model.EffectivePermissions = model.RoleCategoryPermissions
|
||||
.SelectMany(group => group.Value)
|
||||
.Where(permission => _authorizationService.TryCheckAccess(permission, simulation, null))
|
||||
.Select(permission=>permission.Name)
|
||||
|
@@ -113,9 +113,9 @@ namespace Orchard.Roles.Services {
|
||||
string title = String.IsNullOrWhiteSpace(category) ? T("{0} Feature", featureName).Text : T(category).Text;
|
||||
|
||||
if ( installedPermissions.ContainsKey(title) )
|
||||
installedPermissions[title] = installedPermissions[title].Concat( new [] {permission});
|
||||
installedPermissions[title] = installedPermissions[title].Concat( new [] {permission} );
|
||||
else
|
||||
installedPermissions.Add(title, permissions);
|
||||
installedPermissions.Add(title, new[] { permission });
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@ namespace Orchard.Roles.ViewModels {
|
||||
public int Id { get; set; }
|
||||
[Required]
|
||||
public string Name { get; set; }
|
||||
public IDictionary<string, IEnumerable<Permission>> FeaturePermissions { get; set; }
|
||||
public IDictionary<string, IEnumerable<Permission>> RoleCategoryPermissions { get; set; }
|
||||
public IEnumerable<string> CurrentPermissions { get; set; }
|
||||
public IEnumerable<string> EffectivePermissions { get; set; }
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>@T("Permissions")</legend>
|
||||
@foreach (var category in Model.FeaturePermissions.Keys) {
|
||||
@foreach (var category in Model.RoleCategoryPermissions.Keys) {
|
||||
<fieldset>
|
||||
<legend>@category</legend>
|
||||
<table class="items">
|
||||
@@ -26,7 +26,7 @@
|
||||
<th scope="col">@T("Effective")</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach (var permission in Model.FeaturePermissions[category]) {
|
||||
@foreach (var permission in Model.RoleCategoryPermissions[category]) {
|
||||
<tr>
|
||||
<td>@permission.Description</td>
|
||||
<td style="width:60px;">
|
||||
|
Reference in New Issue
Block a user