Absract metatype impl (#2575)
* Add common "interface" for metadata supporting entities * Add common metadata implementation for distribution set and software module * Extract PermissionSupport + extend by TargetManagement * TargetManagement tags are now protected by Target permissions - as it should be --------- Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -64,9 +64,9 @@ public class RepositoryConfiguration {
|
||||
public boolean hasPermission(final Authentication authentication, final Object targetDomainObject, final Object permission) {
|
||||
if (targetDomainObject instanceof MethodSecurityExpressionOperations root) {
|
||||
final String neededPermission =
|
||||
permission + "_" + (root.getThis() instanceof RepositoryManagement<?, ?, ?> repositoryManagement
|
||||
? repositoryManagement.permissionGroup()
|
||||
: "REPOSITORY"); // TODO - should not fall back here - all using parmissions should extend repository management interface
|
||||
permission + "_" + (root.getThis() instanceof PermissionSupport permissionSupport
|
||||
? permissionSupport.permissionGroup()
|
||||
: "REPOSITORY"); // TODO - should not fall back here - all using permissions should extend repository management interface
|
||||
final boolean hasPermission = roleHierarchy.getReachableGrantedAuthorities(authentication.getAuthorities()).stream()
|
||||
.map(GrantedAuthority::getAuthority)
|
||||
.anyMatch(authority -> authority.equals(neededPermission));
|
||||
|
||||
Reference in New Issue
Block a user