Class DefaultSpacePermissionManager

    • Method Detail

      • flushCaches

        public void flushCaches()
      • removePermission

        public void removePermission​(SpacePermission permission)
        Removes the specified permission.
        Parameters:
        permission - the permission to remove
      • removeGlobalPermissionForUser

        public void removeGlobalPermissionForUser​(ConfluenceUser user,
                                                  String permissionType)
        Description copied from interface: SpacePermissionManager
        Removes global permission of specified type that is directly associated with a user, and generates a SpacePermissionsRemoveForUserEvent in the process.
        Parameters:
        user - the user to look up
        permissionType - the permission type to remove
      • removeAllPermissions

        public void removeAllPermissions​(Space space)
        Description copied from interface: SpacePermissionManager
        Removes all permissions belonging to space
        Parameters:
        space - The space to remove the permissions for
      • removeAllPermissions

        public void removeAllPermissions​(Space space,
                                         SpacePermissionContext context)
        Description copied from interface: SpacePermissionManagerInternal
        Removes all permissions belonging to space
        Parameters:
        space - The space to remove the permissions for
        context - The context for this removal
      • removeAllPermissionsFromDao

        protected void removeAllPermissionsFromDao​(Space space)
      • createPrivateSpacePermissions

        public void createPrivateSpacePermissions​(Space space)
      • createDefaultSpacePermissions

        public void createDefaultSpacePermissions​(Space space)
      • getUsersWithPermissions

        public Collection<com.atlassian.user.User> getUsersWithPermissions​(@Nullable Space space)
        Description copied from interface: SpacePermissionManager
        Returns a collection of user objects with VIEWSPACE_PERMISSION in the space. If no space is provided A list of users with USE_CONFLUENCE_PERMISSION will be returned
        Parameters:
        space - - space to query, if null global permissions returned
        Returns:
        Collection of User objects
      • getGroupsWithPermissions

        public Collection<com.atlassian.user.Group> getGroupsWithPermissions​(@Nullable Space space)
        Description copied from interface: SpacePermissionManager
        Returns all groups which have permissions in a space or on a global level. If space is null, permissions on the global level will be checked.
        Parameters:
        space - - space to query, if null global permissions returned
        Returns:
        Collection of groups with permissions
      • getUsersForPermissionType

        public Map<String,​Long> getUsersForPermissionType​(String permissionType,
                                                                @Nullable Space space)
      • getGroupsForPermissionType

        public Map<String,​Long> getGroupsForPermissionType​(String permissionType,
                                                                 @Nullable Space space)
        Returns:
        a map with keys that are String groupNames and values that are Long Group permissionId. The keys in the Map are not case sensitive.
      • permissionExists

        public boolean permissionExists​(SpacePermission permission)
        Determines if permission exists in the SpacePermissionDao
        Parameters:
        permission - The SpacePermission object to look up
        Returns:
        true if present, false otherwise
      • savePermissionToDao

        protected void savePermissionToDao​(SpacePermission permission)
        Saves the permission to the data store

        This may be overridden to provide caching, where applicable.

        Parameters:
        permission - the SpacePermission to be saved
      • removePermissionFromDao

        protected void removePermissionFromDao​(SpacePermission realPermission)
        Removes the permission from the data store

        This may be overridden to provide caching, where applicable

        Parameters:
        realPermission - the SpacePermission to be removed