protected ObjectPermissionSet getRelevantPermissionSet ( ModeledUser user , ModeledPermissions < ? extends EntityModel > targetEntity ) throws GuacamoleException { if ( targetEntity . isUser ( ) ) return user . getUserPermissions ( ) ; if ( targetEntity . isUserGroup ( ) ) return user . getUserGroupPermissions ( ) ; // Entities should be only users or groups throw new UnsupportedOperationException ( "Unexpected entity type." ) ; }
Returns the ObjectPermissionSet related to the type of the given entity . If the given entity represents a user then the ObjectPermissionSet containing user permissions is returned . If the given entity represents a user group then the ObjectPermissionSet containing user group permissions is returned .