Skip to content

Commit

Permalink
Cleaned up old getAllowedRoles logic for #65
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelProminic committed Nov 18, 2024
1 parent 554d5a4 commit 1906af1
Show file tree
Hide file tree
Showing 20 changed files with 57 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
// return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use getRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
// return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use getRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
// return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use getRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
// return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use getRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
//return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
// return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
// return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
// return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
//return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
// return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
// return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
// return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
// return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
// return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
// return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
// return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
return null; // use GetRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
//return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
return null; // use getRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public String getRoleRestrictionID() {

@Override
public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
// return SecurityBuilder.buildList(SecurityBuilder.ROLE_ADMINISTRATOR);
return null; // use GetRoleRestrictionID
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public String getRoleRestrictionID() {
}

public Collection<String> getAllowedRoles() {
return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
//return SecurityBuilder.buildList(SimpleRoleSecurity.ROLE_ALL);
return null; // use getRoleRestrictionID
}

public SecurityInterface checkSecurity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,25 +190,25 @@ class SimpleRoleSecuritySpec extends Specification {
new ConfigRead() | ['All']
new XMLAuthenticationTest() | ['All']
// the rest were changed to useRoleRestrictionID
// new DocumentationFormRead() | ['All']
// new DocumentationFormDelete() | ['All']
// new DocumentationFormCreate() | ['All']
// new DocumentationFormUpdate() | ['All']
// new CategoryRead() | ['All']
// new CategoryDelete() | ['All']
// new CategoryCreate() | ['All']
// new CategoryUpdate() | ['All']
// new CustomBookmarkDelete() | ['Administrator']
// new CustomBookmarkCreate() | ['Administrator']
// new CustomBookmarkUpdate() | ['Administrator']
// new CustomBookmarkRead() | ['All']
// new DatabaseRead() | ['All']
// new GenesisDirectoryUpdate() | ['Administrator']
// new GenesisDirectoryCreate() | ['Administrator']
// new GenesisDirectoryDelete() | ['Administrator']
// new GenesisDirectoryRead() | ['Administrator']
// new GenesisRead() | ['All']
// new GenesisInstall() | ['Administrator']
new DocumentationFormRead() | null //['All']
new DocumentationFormDelete() | null //['All']
new DocumentationFormCreate() | null //['All']
new DocumentationFormUpdate() | null //['All']
new CategoryRead() | null //['All']
new CategoryDelete() | null //['All']
new CategoryCreate() | null //['All']
new CategoryUpdate() | null //['All']
new CustomBookmarkDelete() | null //['Administrator']
new CustomBookmarkCreate() | null //'Administrator']
new CustomBookmarkUpdate() | null //['Administrator']
new CustomBookmarkRead() | null //['All']
new DatabaseRead() | null //['All']
new GenesisDirectoryUpdate() | null //['Administrator']
new GenesisDirectoryCreate() | null //['Administrator']
new GenesisDirectoryDelete() | null //['Administrator']
new GenesisDirectoryRead() | null //['Administrator']
new GenesisRead() | null //['All']
new GenesisInstall() | null //['Administrator']



Expand Down

0 comments on commit 1906af1

Please sign in to comment.