mirror of https://github.com/abpframework/abp.git
committed by
GitHub
18 changed files with 133 additions and 43 deletions
@ -0,0 +1,16 @@ |
|||||
|
using Volo.Abp.Reflection; |
||||
|
|
||||
|
namespace Volo.Abp.FeatureManagement |
||||
|
{ |
||||
|
public class FeatureManagementPermissions |
||||
|
{ |
||||
|
public const string GroupName = "FeatureManagement"; |
||||
|
|
||||
|
public const string ManageHostFeatures = GroupName + ".ManageHostFeatures"; |
||||
|
|
||||
|
public static string[] GetAll() |
||||
|
{ |
||||
|
return ReflectionHelper.GetPublicConstantsRecursively(typeof(FeatureManagementPermissions)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
using Volo.Abp.Authorization.Permissions; |
||||
|
using Volo.Abp.FeatureManagement.Localization; |
||||
|
using Volo.Abp.Localization; |
||||
|
using Volo.Abp.MultiTenancy; |
||||
|
|
||||
|
namespace Volo.Abp.FeatureManagement |
||||
|
{ |
||||
|
public class FeaturePermissionDefinitionProvider : PermissionDefinitionProvider |
||||
|
{ |
||||
|
public override void Define(IPermissionDefinitionContext context) |
||||
|
{ |
||||
|
var featureManagementGroup = context.AddGroup( |
||||
|
FeatureManagementPermissions.GroupName, |
||||
|
L("Permission:FeatureManagement"), |
||||
|
multiTenancySide: MultiTenancySides.Host); |
||||
|
|
||||
|
featureManagementGroup.AddPermission( |
||||
|
FeatureManagementPermissions.ManageHostFeatures, |
||||
|
L("Permission:FeatureManagement.ManageHostFeatures"), |
||||
|
multiTenancySide: MultiTenancySides.Host); |
||||
|
} |
||||
|
|
||||
|
private static LocalizableString L(string name) |
||||
|
{ |
||||
|
return LocalizableString.Create<AbpFeatureManagementResource>(name); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue