mirror of https://github.com/abpframework/abp.git
11 changed files with 58 additions and 47 deletions
@ -0,0 +1,12 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.Permissions |
|||
{ |
|||
public static class PermissionCheckerExtensions |
|||
{ |
|||
public static async Task<bool> IsGrantedAsync(this IPermissionChecker permissionChecker, string name) |
|||
{ |
|||
return (await permissionChecker.CheckAsync(name)).IsGranted; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.Permissions |
|||
{ |
|||
public class PermissionValueProviderGrantInfo |
|||
{ |
|||
public static PermissionValueProviderGrantInfo NonGranted { get; } = new PermissionValueProviderGrantInfo(false); |
|||
|
|||
public virtual bool IsGranted { get; } |
|||
|
|||
public virtual string ProviderKey { get; } |
|||
|
|||
public PermissionValueProviderGrantInfo(bool isGranted, [CanBeNull] string providerKey = null) |
|||
{ |
|||
IsGranted = isGranted; |
|||
ProviderKey = providerKey; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue