예제 #1
0
 public async Task UpdateAsync(string providerName, string providerKey, UpdatePermissionsDto input)
 {
     foreach (var permission in input.Permissions)
     {
         await _permissionManager.SetAsync(permission.Name, providerName, providerKey, permission.IsGranted);
     }
 }
예제 #2
0
        public async Task UpdateAsync(string providerName, string providerKey, UpdatePermissionsDto input)
        {
            await CheckProviderPolicy(providerName);

            foreach (var permissionDto in input.Permissions)
            {
                var permissionDefinition = _permissionDefinitionManager.Get(permissionDto.Name);
                if (permissionDefinition.Providers.Any() &&
                    !permissionDefinition.Providers.Contains(providerName))
                {
                    throw new ApplicationException($"The permission named '{permissionDto.Name}' has not compatible with the provider named '{providerName}'");
                }

                await _permissionManager.SetAsync(permissionDto.Name, providerName, providerKey, permissionDto.IsGranted);
            }
        }
예제 #3
0
        public virtual async Task UpdateAsync(string providerName, string providerKey, UpdatePermissionsDto input)
        {
            await CheckProviderPolicy(providerName);

            foreach (var permissionDto in input.Permissions)
            {
                await PermissionManager.SetAsync(permissionDto.Name, providerName, providerKey, permissionDto.IsGranted);
            }
        }
예제 #4
0
 public virtual Task UpdateAsync(string providerName, string providerKey, UpdatePermissionsDto input)
 {
     return(PermissionAppService.UpdateAsync(providerName, providerKey, input));
 }