protected boolean canUpdateModifiedParents ( ModeledAuthenticatedUser user , String identifier , ModelType model ) throws GuacamoleException { // If user is an administrator, no need to check if ( user . getUser ( ) . isAdministrator ( ) ) return true ; // Verify that we have permission to modify any modified parents Collection < String > modifiedParents = getModifiedParents ( user , identifier , model ) ; if ( ! modifiedParents . isEmpty ( ) ) { ObjectPermissionSet permissionSet = getParentEffectivePermissionSet ( user ) ; Collection < String > updateableParents = permissionSet . getAccessibleObjects ( Collections . singleton ( ObjectPermission . Type . UPDATE ) , modifiedParents ) ; return updateableParents . size ( ) == modifiedParents . size ( ) ; } return true ; }
Returns whether the given user has permission to modify the parents affected by the modifications made to the given model object .