Interface SecurityManager

  • All Known Implementing Classes:
    SecurityManagerImpl

    public interface SecurityManager
    Manager for security objects like users and groups
    Since:
    3.0
    Author:
    Marco Meschieri - LogicalDOC
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Set<Group> getAllowedGroups​(long menuId)
      Retrieves the collection of groups that can access the given menu
      Set<Permission> getEnabledPermissions​(long docId, long userId)
      Finds all permissions of a user enabled on the specified document
      boolean isDownloadEnabled​(long docId, long userId)  
      boolean isMemberOf​(long userId, long groupId)
      Checks if a given user is member of a particular group
      boolean isMemberOf​(long userId, String groupName)
      Checks if a given user is member of a particular group
      boolean isPermissionEnabled​(Permission permission, long docId, long userId)
      This method checks if the given permission is enabled for a document and an user.
      boolean isPrintEnabled​(long docId, long userId)  
      boolean isReadEnabled​(long docId, long userId)  
      boolean isWriteEnabled​(long docId, long userId)
      This method is looking up for writing rights for a folder and an user.
    • Method Detail

      • getAllowedGroups

        Set<Group> getAllowedGroups​(long menuId)
        Retrieves the collection of groups that can access the given menu
        Parameters:
        menuId - The menu to consider
        Returns:
        The collection of allowed groups
      • isMemberOf

        boolean isMemberOf​(long userId,
                           long groupId)
        Checks if a given user is member of a particular group
        Parameters:
        userId - The user identifier
        groupId - The group identifier
        Returns:
        true only if the user belongs to the group
      • isMemberOf

        boolean isMemberOf​(long userId,
                           String groupName)
        Checks if a given user is member of a particular group
        Parameters:
        userId - The user identifier
        groupName - The group name
        Returns:
        true only if the user belongs to the group
      • isWriteEnabled

        boolean isWriteEnabled​(long docId,
                               long userId)
        This method is looking up for writing rights for a folder and an user.
        Parameters:
        docId - ID of the document
        userId - ID of the user
        Returns:
        if the user has the write permission on the document
      • isReadEnabled

        boolean isReadEnabled​(long docId,
                              long userId)
      • isPrintEnabled

        boolean isPrintEnabled​(long docId,
                               long userId)
      • isDownloadEnabled

        boolean isDownloadEnabled​(long docId,
                                  long userId)
      • isPermissionEnabled

        boolean isPermissionEnabled​(Permission permission,
                                    long docId,
                                    long userId)
        This method checks if the given permission is enabled for a document and an user.
        Parameters:
        permission - the permission to check
        docId - ID of the document
        userId - ID of the user
        Returns:
        if the permission is granted to the user on the document
      • getEnabledPermissions

        Set<Permission> getEnabledPermissions​(long docId,
                                              long userId)
        Finds all permissions of a user enabled on the specified document
        Parameters:
        docId - ID of the document
        userId - ID of the user
        Returns:
        Collection of permissions granted to the user on the document