Skip to content

Commit

Permalink
Added SRAM to services scope
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Jun 27, 2024
1 parent 8c7ada2 commit 236e3c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions manage-server/src/main/java/manage/api/Scope.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public enum Scope {
READ, //Allowed to read entities
SYSTEM, //Allowed everything including Attribute Manipulation
TEST, //Only used internally
WRITE_SP, //Allowed to CRU SP / RP /RS
DELETE_SP, //Allowed to Delete SP / RP /RS
WRITE_SP, //Allowed to CRU SP / RP / RS / SRAM
DELETE_SP, //Allowed to Delete SP / RP / RS
WRITE_IDP //Allowed to CRUD IdP

}
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ public List<StatsEntry> stats(FederatedUser user) {

@PreAuthorize("hasAnyRole('WRITE_SP', 'WRITE_IDP', 'SYSTEM')")
@PostMapping("/internal/metadata")
public MetaData postInternal(@Validated @RequestBody MetaData metaData, APIUser apiUser)
throws JsonProcessingException {
public MetaData postInternal(@Validated @RequestBody MetaData metaData, APIUser apiUser) {
ScopeEnforcer.enforceWriteScope(apiUser, EntityType.fromType(metaData.getType()) );
return metaDataService.doPost(metaData, apiUser, !apiUser.getScopes().contains(TEST));
}
Expand Down
2 changes: 1 addition & 1 deletion manage-server/src/main/java/manage/web/ScopeEnforcer.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class ScopeEnforcer {

private final static List<EntityType> spEntityTypes = List.of(EntityType.SP, EntityType.RP, EntityType.RS);
private final static List<EntityType> spEntityTypes = List.of(EntityType.SP, EntityType.RP, EntityType.RS, EntityType.SRAM);

private final static List<EntityType> allEntityTypes = List.of(EntityType.SP, EntityType.RP, EntityType.RS, EntityType.IDP);

Expand Down

0 comments on commit 236e3c1

Please sign in to comment.