mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
27 lines
866 B
C#
27 lines
866 B
C#
using System.Collections.Generic;
|
|
using Orchard.Environment.Extensions.Models;
|
|
using Orchard.Security.Permissions;
|
|
|
|
namespace Orchard.Widgets {
|
|
public class Permissions : IPermissionProvider {
|
|
public static readonly Permission ManageWidgets = new Permission { Description = "Managing Widgets", Name = "ManageWidgets" };
|
|
|
|
public virtual Feature Feature { get; set; }
|
|
|
|
public IEnumerable<Permission> GetPermissions() {
|
|
return new Permission[] {
|
|
ManageWidgets,
|
|
};
|
|
}
|
|
|
|
public IEnumerable<PermissionStereotype> GetDefaultStereotypes() {
|
|
return new[] {
|
|
new PermissionStereotype {
|
|
Name = "Administrator",
|
|
Permissions = new[] {ManageWidgets}
|
|
},
|
|
};
|
|
}
|
|
|
|
}
|
|
} |