private boolean canAlterRelation ( Collection < String > identifiers ) throws GuacamoleException { // System administrators may alter any relations if ( getCurrentUser ( ) . getUser ( ) . isAdministrator ( ) ) return true ; // Non-admin users require UPDATE permission on the parent object ... if ( ! getParentObjectEffectivePermissionSet ( ) . hasPermission ( ObjectPermission . Type . UPDATE , parent . getIdentifier ( ) ) ) return false ; // ... as well as UPDATE permission on all child objects being changed Collection < String > accessibleIdentifiers = getChildObjectEffectivePermissionSet ( ) . getAccessibleObjects ( Collections . singleton ( ObjectPermission . Type . UPDATE ) , identifiers ) ; return accessibleIdentifiers . size ( ) == identifiers . size ( ) ; }
Returns whether the current user has permission to alter the status of the relation between the parent object and the given child objects .