mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15:11:10 +00:00
Adds provider configuration to media library saves
Moves metadata provider, artwork provider, and book reader choices into the add and update library requests, adds the library type lookups, removes the per-provider enable and reorder endpoints, and reconciles the stored configurations in one provider store call. Tightens library update and delete authorization to require ownership and the manage permission, and cleans up enum validation, comments, resource diacritics, and Razor imports.
This commit is contained in:
1 parent
2e7563199a
commit
48ad8692af
148 files changed
+6305
-2936
No files matched your search
@@ -24,12 +24,18 @@ public class PermissionAuthorizationHandler : AuthorizationHandler<PermissionReq
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Succeeds the requirement when the currently logged in user holds any of the required permissions.
|
||||
/// Succeeds the requirement when the currently logged in user is an administrator, or holds any of the required permissions.
|
||||
/// </summary>
|
||||
/// <param name="authorizationHandlerContext">The authorization context.</param>
|
||||
/// <param name="permissionRequirement">The permission requirement to evaluate.</param>
|
||||
protected override async Task HandleRequirementAsync(AuthorizationHandlerContext authorizationHandlerContext, PermissionRequirement permissionRequirement)
|
||||
{
|
||||
// The API lets administrators do what the permission allows even when they do not hold it, so the Web does not deny them what the API grants.
|
||||
if (await _authorizationService.IsInRoleAsync("Admin", CancellationToken.None).ConfigureAwait(false))
|
||||
{
|
||||
authorizationHandlerContext.Succeed(permissionRequirement);
|
||||
return;
|
||||
}
|
||||
foreach (AuthorizationPermission permission in permissionRequirement.Permissions)
|
||||
{
|
||||
if (await _authorizationService.HasPermissionAsync(permission, CancellationToken.None).ConfigureAwait(false))
|
||||
|
||||
Reference in new issue
Block a user