Package com.logicaldoc.core.security
Class SecurityManagerImpl
java.lang.Object
com.logicaldoc.core.security.SecurityManagerImpl
- All Implemented Interfaces:
SecurityManager
Basic implementation of
SecurityManager- Since:
- 3.0
- Author:
- Marco Meschieri - LogicalDOC
-
Method Summary
Modifier and TypeMethodDescriptiongetAllowedGroups(long menuId) Retrieves the collection of groups that can access the given menugetEnabledPermissions(long docId, long userId) Finds all permissions of a user enabled on the specified documentbooleanisDownloadEnabled(long docId, long userId) booleanisMemberOf(long userId, long groupId) Checks if a given user is member of a particular groupbooleanisMemberOf(long userId, String groupName) Checks if a given user is member of a particular groupbooleanisPermissionEnabled(Permission permission, long docId, long userId) This method checks if the given permission is enabled for a document and an user.booleanisPrintEnabled(long docId, long userId) booleanisReadEnabled(long docId, long userId) booleanisWriteEnabled(long docId, long userId) This method is looking up for writing rights for a folder and an user.voidsetDocumentDAO(DocumentDAO documentDAO) voidsetFolderDAO(FolderDAO folderDAO) voidsetGroupDAO(GroupDAO groupDAO) voidsetMenuDAO(MenuDAO menuDAO) voidsetUserDAO(UserDAO userDAO)
-
Method Details
-
setMenuDAO
-
setGroupDAO
-
setUserDAO
-
getAllowedGroups
Description copied from interface:SecurityManagerRetrieves the collection of groups that can access the given menu- Specified by:
getAllowedGroupsin interfaceSecurityManager- Parameters:
menuId- The menu to consider- Returns:
- The collection of allowed groups
-
isMemberOf
public boolean isMemberOf(long userId, long groupId) Description copied from interface:SecurityManagerChecks if a given user is member of a particular group- Specified by:
isMemberOfin interfaceSecurityManager- Parameters:
userId- The user identifiergroupId- The group identifier- Returns:
- true only if the user belongs to the group
-
isMemberOf
Description copied from interface:SecurityManagerChecks if a given user is member of a particular group- Specified by:
isMemberOfin interfaceSecurityManager- Parameters:
userId- The user identifiergroupName- The group name- Returns:
- true only if the user belongs to the group
-
isWriteEnabled
Description copied from interface:SecurityManagerThis method is looking up for writing rights for a folder and an user.- Specified by:
isWriteEnabledin interfaceSecurityManager- Parameters:
docId- ID of the documentuserId- ID of the user- Returns:
- if the user has the write permission on the document
- Throws:
PersistenceException- error at data layer
-
isReadEnabled
- Specified by:
isReadEnabledin interfaceSecurityManager- Throws:
PersistenceException
-
isPrintEnabled
- Specified by:
isPrintEnabledin interfaceSecurityManager- Throws:
PersistenceException
-
isDownloadEnabled
- Specified by:
isDownloadEnabledin interfaceSecurityManager- Throws:
PersistenceException
-
isPermissionEnabled
public boolean isPermissionEnabled(Permission permission, long docId, long userId) throws PersistenceException Description copied from interface:SecurityManagerThis method checks if the given permission is enabled for a document and an user.- Specified by:
isPermissionEnabledin interfaceSecurityManager- Parameters:
permission- the permission to checkdocId- ID of the documentuserId- ID of the user- Returns:
- if the permission is granted to the user on the document
- Throws:
PersistenceException- error at data layer
-
getEnabledPermissions
Description copied from interface:SecurityManagerFinds all permissions of a user enabled on the specified document- Specified by:
getEnabledPermissionsin interfaceSecurityManager- Parameters:
docId- ID of the documentuserId- ID of the user- Returns:
- Collection of permissions granted to the user on the document
- Throws:
PersistenceException- error at data layer
-
setFolderDAO
-
setDocumentDAO
-