Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private static async Task<IResult> Handle(
return Results.NotFound();
}

if (!accessValidator.IsActionAllowed(apiKey.Organization, Actions.GenericWrite))
if (!accessValidator.IsActionAllowed(apiKey, Actions.GenericWrite))
{
return Results.Forbid();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private static async Task<IResult> Handle(
return Results.NotFound();
}

if (!accessValidator.IsActionAllowed(apiKey.Organization, Actions.GenericRead))
if (!accessValidator.IsActionAllowed(apiKey, Actions.GenericRead))
{
return Results.Forbid();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private static async Task<IResult> Handle(
return Results.NotFound();
}

if (!accessValidator.IsActionAllowed(apiKey.Organization, Actions.GenericWrite))
if (!accessValidator.IsActionAllowed(apiKey, Actions.GenericWrite))
{
return Results.Forbid();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private static async Task<IResult> Handle(
return Results.NotFound();
}

if (!accessValidator.IsActionAllowed(organization, Actions.GenericWrite))
if (!accessValidator.IsActionAllowed(organization, Actions.PrivilegedDelete))
{
return Results.Forbid();
}
Expand Down
5 changes: 5 additions & 0 deletions src/Turnierplan.App/Security/Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ internal static class Actions
/// </summary>
public static readonly Action ReadOrWriteRoleAssignments = new(Role.Owner);

/// <summary>
/// A special kind of delete action which shall require the <see cref="Role.Owner"/> role on the target entity.
/// </summary>
public static readonly Action PrivilegedDelete = new(Role.Owner);

/// <summary>
/// Any action that modifies some entity.
/// </summary>
Expand Down
Loading