Interface ObjectPermissionSet

    • Field Detail

      • EMPTY_SET

        static final ObjectPermissionSet EMPTY_SET
        An immutable instance of ObjectPermissionSet which contains no permissions.
    • Method Detail

      • hasPermission

        boolean hasPermission​(ObjectPermission.Type permission,
                              String identifier)
                       throws org.apache.guacamole.GuacamoleException
        Tests whether the permission of the given type is granted for the object having the given identifier.
        Parameters:
        permission - The permission to check.
        identifier - The identifier of the object affected by the permission being checked.
        Returns:
        true if the permission is granted, false otherwise.
        Throws:
        org.apache.guacamole.GuacamoleException - If an error occurs while checking permissions, or if permissions cannot be checked due to lack of permissions to do so.
      • addPermission

        void addPermission​(ObjectPermission.Type permission,
                           String identifier)
                    throws org.apache.guacamole.GuacamoleException
        Adds the specified permission for the object having the given identifier.
        Parameters:
        permission - The permission to add.
        identifier - The identifier of the object affected by the permission being added.
        Throws:
        org.apache.guacamole.GuacamoleException - If an error occurs while adding the permission, or if permission to add permissions is denied.
      • removePermission

        void removePermission​(ObjectPermission.Type permission,
                              String identifier)
                       throws org.apache.guacamole.GuacamoleException
        Removes the specified permission for the object having the given identifier.
        Parameters:
        permission - The permission to remove.
        identifier - The identifier of the object affected by the permission being added.
        Throws:
        org.apache.guacamole.GuacamoleException - If an error occurs while removing the permission, or if permission to remove permissions is denied.
      • getAccessibleObjects

        Collection<String> getAccessibleObjects​(Collection<ObjectPermission.Type> permissions,
                                                Collection<String> identifiers)
                                         throws org.apache.guacamole.GuacamoleException
        Tests whether this user has the specified permissions for the objects having the given identifiers. The identifier of an object is returned in a new collection if at least one of the specified permissions is granted for that object.
        Parameters:
        permissions - The permissions to check. An identifier will be included in the resulting collection if at least one of these permissions is granted for the associated object
        identifiers - The identifiers of the objects affected by the permissions being checked.
        Returns:
        A collection containing the subset of identifiers for which at least one of the specified permissions is granted.
        Throws:
        org.apache.guacamole.GuacamoleException - If an error occurs while checking permissions, or if permissions cannot be checked due to lack of permissions to do so.
      • getPermissions

        Set<ObjectPermission> getPermissions()
                                      throws org.apache.guacamole.GuacamoleException
        Description copied from interface: PermissionSet
        Returns a Set which contains all permissions granted within this permission set.
        Specified by:
        getPermissions in interface PermissionSet<ObjectPermission>
        Returns:
        A Set containing all permissions granted within this permission set.
        Throws:
        org.apache.guacamole.GuacamoleException - If an error occurs while retrieving permissions, or if permissions cannot be retrieved due to lack of permissions to do so.
      • addPermissions

        void addPermissions​(Set<ObjectPermission> permissions)
                     throws org.apache.guacamole.GuacamoleException
        Description copied from interface: PermissionSet
        Adds the specified permissions, if not already granted. If a specified permission is already granted, no operation is performed regarding that permission.
        Specified by:
        addPermissions in interface PermissionSet<ObjectPermission>
        Parameters:
        permissions - The permissions to add.
        Throws:
        org.apache.guacamole.GuacamoleException - If an error occurs while adding the permissions, or if permission to add permissions is denied.
      • removePermissions

        void removePermissions​(Set<ObjectPermission> permissions)
                        throws org.apache.guacamole.GuacamoleException
        Description copied from interface: PermissionSet
        Removes each of the specified permissions, if granted. If a specified permission is not granted, no operation is performed regarding that permission.
        Specified by:
        removePermissions in interface PermissionSet<ObjectPermission>
        Parameters:
        permissions - The permissions to remove.
        Throws:
        org.apache.guacamole.GuacamoleException - If an error occurs while removing the permissions, or if permission to remove permissions is denied.