api/src/main/java/com/epam/pipeline/manager/security/metadata/MetadataPermissionManager.java
public boolean metadataPermission(final Long entityId, final AclClass entityClass, final String permission) {
        if (permissionHelper.isAdmin()) {
            return true;
        }
        if (entityClass.isSupportsEntityManager()) {
            final AbstractSecuredEntity securedEntity = entityManager.load(entityClass, entityId);
            return permissionHelper.isAllowed(permission, securedEntity);
        }
        if (entityClass.equals(AclClass.ROLE)) {
            return false;
        }
        if (entityClass.equals(AclClass.PIPELINE_USER)) {
            return isSameUser(entityId);
        }
        return false;
    }
/**
     * - For basic ACL entities (FOLDER, PIPELINE, etc.) admins and
     * users with corresponding permission granted are allowed
     * - For ROLE entity only admins are allowed
     * - For PIPELINE_USER admins are allowed, users are allowed to access own metadata
     * @param entityId
     * @param entityClass
     * @param permission
     * @return
     */
- For basic ACL entities (FOLDER, PIPELINE, etc.) admins and
users with corresponding permission granted are allowed
- For ROLE entity only admins are allowed
- For PIPELINE_USER admins are allowed, users are allowed to access own metadata
@param entityId
@param entityClass
@param permission
@return
- For basic ACL entities ( FOLDER PIPELINE etc . ) admins and users with corresponding permission granted are allowed - For ROLE entity only admins are allowed - For PIPELINE_USER admins are allowed users are allowed to access own metadata @param entityId @param entityClass @param permission @return
public boolean metadataPermission(final Long entityId, final AclClass entityClass, final String permission) {
        if (permissionHelper.isAdmin()) {
            return true;
        }
        if (entityClass.isSupportsEntityManager()) {
            final AbstractSecuredEntity securedEntity = entityManager.load(entityClass, entityId);
            return permissionHelper.isAllowed(permission, securedEntity);
        }
        if (entityClass.equals(AclClass.ROLE)) {
            return false;
        }
        if (entityClass.equals(AclClass.PIPELINE_USER)) {
            return isSameUser(entityId);
        }
        return false;
    }
public boolean metadataPermission ( final Long entityId , final AclClass entityClass , final String permission ) { if ( permissionHelper . isAdmin ( ) ) { return true ; } if ( entityClass . isSupportsEntityManager ( ) ) { final AbstractSecuredEntity securedEntity = entityManager . load ( entityClass , entityId ) ; return permissionHelper . isAllowed ( permission , securedEntity ) ; } if ( entityClass . equals ( AclClass . ROLE ) ) { return false ; } if ( entityClass . equals ( AclClass . PIPELINE_USER ) ) { return isSameUser ( entityId ) ; } return false ; }
- For basic ACL entities (FOLDER, PIPELINE, etc.)
- For basic ACL entities ( FOLDER PIPELINE etc . )