mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-24 05:42:10 +08:00
ManageUsers, ManageRoles, AssignRoles and SiteSettings are new permission which makes it possible to have Administrators roles without the need of SiteOwner. Typical scenario: "super" account is SiteOwner "admin" account is Administrator without SiteOwner, but with ManageUsers, ManageRoles and SiteSettings but NOT AssignRoles
27 lines
817 B
C#
27 lines
817 B
C#
using System.Collections.Generic;
|
|
using Orchard.Environment.Extensions.Models;
|
|
using Orchard.Security.Permissions;
|
|
|
|
namespace Orchard.Users {
|
|
public class Permissions : IPermissionProvider {
|
|
public static readonly Permission ManageUsers = new Permission { Description = "Managing Users", Name = "ManageUsers" };
|
|
|
|
public virtual Feature Feature { get; set; }
|
|
|
|
public IEnumerable<Permission> GetPermissions() {
|
|
return new[] {
|
|
ManageUsers,
|
|
};
|
|
}
|
|
|
|
public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {
|
|
return new[] {
|
|
new PermissionStereotype {
|
|
Name = "Administrator",
|
|
Permissions = new[] {ManageUsers}
|
|
},
|
|
};
|
|
}
|
|
|
|
}
|
|
} |