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); } }
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); } }
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); } }
public virtual Task UpdateAsync(string providerName, string providerKey, UpdatePermissionsDto input) { return(PermissionAppService.UpdateAsync(providerName, providerKey, input)); }