Class ProjectPermissions


  • public final class ProjectPermissions
    extends Object
    This class is used to specify permissions to share an item to projects. It is a three-step procedure: Don't forget to commit the transaction.

    NOTE! As of BASE 2.6 this class is final because of a security issue. Existing code that has subclassed this class will no longer work. There is no workaround.

    Version:
    2.0
    Author:
    Nicklas
    See Also:
    ProjectKey
    Last modified
    $Date: 2010-06-22 14:51:41 +0200 (ti, 22 jun 2010) $
    • Constructor Detail

      • ProjectPermissions

        public ProjectPermissions()
        Create a new empty object.
      • ProjectPermissions

        public ProjectPermissions​(ProjectKey projectKey)
                           throws InvalidDataException
        Create a new object, and initialise it with the permissions from a ProjectKey.
        Parameters:
        projectKey - The project key from which we take the current permissions
        Throws:
        InvalidDataException - If the project key is null
    • Method Detail

      • merge

        public void merge​(ProjectKey projectKey)
        Merge the permissions for all projects from the given project key with the permissions in this object. If the project key contains permissions for a project that already has permissions in this object the permissions are combined (added) to create a new permission.
        Parameters:
        projectKey - A project key (if null, this method simply returns)
        Since:
        2.16
      • hasChanged

        public boolean hasChanged​(Project project)
        Check if the current permissions for the project has been changed from the original permissions. This method will return false if the getPermissions(Project) returns a set with the same permissions getOriginalPermissions(Project).
        Parameters:
        project - The project to check
        Returns:
        TRUE if the permissions have changed, FALSE otherwise
        Throws:
        InvalidDataException - If the project is null
        Since:
        2.6
      • size

        public int size()
        Get the number of entries.
      • getProjectPermissions

        final Map<ProjectData,​Integer> getProjectPermissions()
        Get the internal representation of the permissions.
      • getOriginalPermissions

        final Map<ProjectData,​Integer> getOriginalPermissions()
        Get the internal representation of the original permissions.
        Since:
        2.6