Skip to content

Commit

Permalink
apply new @VaultRole(realmRole=...) property
Browse files Browse the repository at this point in the history
* allowing any user to modify a owned vault
* allowing only users with `create-vaults` role to create vault
* allowing any user to claim ownership (if they can prove worthy)
  • Loading branch information
overheadhunter committed Oct 17, 2024
1 parent f5ac752 commit 508c651
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ public VaultDto get(@PathParam("vaultId") UUID vaultId) {

@PUT
@Path("/{vaultId}")
@RolesAllowed("create-vaults")
@VaultRole(value = VaultAccess.Role.OWNER, onMissingVault = VaultRole.OnMissingVault.PASS)
@RolesAllowed("user") // general authentication. VaultRole filter will check for specific access rights
@VaultRole(value = VaultAccess.Role.OWNER, onMissingVault = VaultRole.OnMissingVault.REQUIRE_REALM_ROLE, realmRole = "create-vaults")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Transactional
Expand Down Expand Up @@ -439,7 +439,7 @@ public Response createOrUpdate(@PathParam("vaultId") UUID vaultId, @Valid @NotNu

@POST
@Path("/{vaultId}/claim-ownership")
@RolesAllowed("create-vaults")
@RolesAllowed("user")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Transactional
@Operation(summary = "claims ownership of a vault",
Expand Down

0 comments on commit 508c651

Please sign in to comment.