|
|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Volo.Abp.Authorization.Permissions;
|
|
|
|
|
using Volo.Abp.Guids;
|
|
|
|
|
using Volo.Abp.MultiTenancy;
|
|
|
|
|
|
|
|
|
|
@ -10,20 +11,24 @@ namespace Volo.Abp.PermissionManagement
|
|
|
|
|
|
|
|
|
|
protected IPermissionGrantRepository PermissionGrantRepository { get; }
|
|
|
|
|
|
|
|
|
|
protected IPermissionStore PermissionStore { get; }
|
|
|
|
|
|
|
|
|
|
protected IGuidGenerator GuidGenerator { get; }
|
|
|
|
|
|
|
|
|
|
protected ICurrentTenant CurrentTenant { get; }
|
|
|
|
|
|
|
|
|
|
protected PermissionManagementProvider(
|
|
|
|
|
IPermissionGrantRepository permissionGrantRepository,
|
|
|
|
|
IPermissionStore permissionStore,
|
|
|
|
|
IGuidGenerator guidGenerator,
|
|
|
|
|
ICurrentTenant currentTenant)
|
|
|
|
|
{
|
|
|
|
|
PermissionGrantRepository = permissionGrantRepository;
|
|
|
|
|
PermissionStore = permissionStore;
|
|
|
|
|
GuidGenerator = guidGenerator;
|
|
|
|
|
CurrentTenant = currentTenant;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual async Task<PermissionValueProviderGrantInfo> CheckAsync(string name, string providerName, string providerKey)
|
|
|
|
|
{
|
|
|
|
|
if (providerName != Name)
|
|
|
|
|
@ -32,7 +37,7 @@ namespace Volo.Abp.PermissionManagement
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new PermissionValueProviderGrantInfo(
|
|
|
|
|
await PermissionGrantRepository.FindAsync(name, providerName, providerKey) != null,
|
|
|
|
|
await PermissionStore.IsGrantedAsync(name, providerName, providerKey),
|
|
|
|
|
providerKey
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -74,4 +79,4 @@ namespace Volo.Abp.PermissionManagement
|
|
|
|
|
await PermissionGrantRepository.DeleteAsync(permissionGrant);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|