mirror of https://github.com/abpframework/abp.git
6 changed files with 106 additions and 10 deletions
@ -0,0 +1,17 @@ |
|||
using Volo.Abp.Permissions; |
|||
|
|||
namespace Volo.Abp.Identity |
|||
{ |
|||
public class IdentityTestPermissionDefinitionProvider : PermissionDefinitionProvider |
|||
{ |
|||
public override void Define(IPermissionDefinitionContext context) |
|||
{ |
|||
var testGroup = context.AddGroup(TestPermissionNames.Groups.TestGroup); |
|||
|
|||
testGroup.AddPermission(TestPermissionNames.MyPermission1); |
|||
|
|||
var myPermission2 = testGroup.AddPermission(TestPermissionNames.MyPermission2); |
|||
myPermission2.AddChild(TestPermissionNames.MyPermission2_ChildPermission1); |
|||
} |
|||
} |
|||
} |
|||
@ -1,10 +1,20 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Permissions; |
|||
|
|||
namespace Volo.Abp.Identity |
|||
{ |
|||
public class PermissionManager_Tests |
|||
public class PermissionManager_Tests : AbpIdentityDomainTestBase |
|||
{ |
|||
private readonly IPermissionManager _permissionManager; |
|||
|
|||
public PermissionManager_Tests() |
|||
{ |
|||
_permissionManager = GetRequiredService<IPermissionManager>(); |
|||
} |
|||
|
|||
public async Task Test1() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,14 @@ |
|||
namespace Volo.Abp.Identity |
|||
{ |
|||
public static class TestPermissionNames |
|||
{ |
|||
public static class Groups |
|||
{ |
|||
public const string TestGroup = "TestGroup"; |
|||
} |
|||
|
|||
public const string MyPermission1 = "MyPermission1"; |
|||
public const string MyPermission2 = "MyPermission2"; |
|||
public const string MyPermission2_ChildPermission1 = "MyPermission2.ChildPermission1"; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue