You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
787 B
26 lines
787 B
using Easy.DDD.Application;
|
|
using Easy.Result;
|
|
using IdentityServer.DDD.Contracts.Inputs;
|
|
using IdentityServer.DDD.Shared.IServices;
|
|
|
|
namespace IdentityServer.DDD.Application;
|
|
|
|
public class PermissionAppService : ApiService
|
|
{
|
|
private IPermissionGrantManager PermissionGrantManager { get; }
|
|
|
|
public PermissionAppService(IPermissionGrantManager permissionGrantManager)
|
|
{
|
|
PermissionGrantManager = permissionGrantManager;
|
|
}
|
|
|
|
public async Task<ApiResult> UpdateAsync(UpdatePermissionsInput input)
|
|
{
|
|
foreach (var permission in input.Permissions)
|
|
{
|
|
await PermissionGrantManager.SetAsync(permission.PermissionName, input.ProviderName, input.ProviderKey, permission.IsGranted);
|
|
}
|
|
return ApiResult.Success();
|
|
}
|
|
|
|
}
|
|
|