Package org.ametys.cms.lock
Class LockContentManager
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.lock.LockContentManager
- All Implemented Interfaces:
- Component,- LogEnabled,- Serviceable
Unlock or lock one or several content(s)
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ContentHelperThe content helperprotected CurrentUserProviderThe current user provider.protected AmetysObjectResolverThe Ametys object resolverprotected RightManagerThe rights managerprotected UserHelperHelper for usersstatic final StringThe component role.static final StringThe "unlock all" right ID.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanUnlock(LockAwareAmetysObject object) Test if the current user can unlock the given locked object.
 A user can unlock a locked object if he is the lock owner, or if he has the right to unlock all objects.booleancanUnlock(LockAwareAmetysObject object, UserIdentity user) Test if a specific user can unlock the given locked object.
 A user can unlock a locked object if he is the lock owner, or if he has the right to unlock all objects.booleanTest if the current user has the right to unlock all contents.booleancanUnlockAll(UserIdentity user) Test if a specific user has the right to unlock all contents.Lock contentsvoidservice(ServiceManager smanager) Unlock contentsunlockOrLock(List<String> contents, String mode) Unlock or lock contentsMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabledenableLogging, getLogger, setupLogger, setupLogger, setupLogger
- 
Field Details- 
ROLEThe component role.
- 
UNLOCK_ALL_RIGHTThe "unlock all" right ID.- See Also:
 
- 
_rightManagerThe rights manager
- 
_resolverThe Ametys object resolver
- 
_currentUserProviderThe current user provider.
- 
_userHelperHelper for users
- 
_contentHelperThe content helper
 
- 
- 
Constructor Details- 
LockContentManagerpublic LockContentManager()
 
- 
- 
Method Details- 
service- Specified by:
- servicein interface- Serviceable
- Throws:
- ServiceException
 
- 
canUnlockTest if the current user can unlock the given locked object.
 A user can unlock a locked object if he is the lock owner, or if he has the right to unlock all objects.- Parameters:
- object- the locked object to test.
- Returns:
- true if the current user can unlock the given locked object, false otherwise.
 
- 
canUnlockTest if a specific user can unlock the given locked object.
 A user can unlock a locked object if he is the lock owner, or if he has the right to unlock all objects.- Parameters:
- object- the locked object to test.
- user- the user.
- Returns:
- true if the current user can unlock the given locked object, false otherwise.
 
- 
canUnlockAllTest if the current user has the right to unlock all contents.- Returns:
- true if the current user has the right to unlock all contents, false otherwise.
 
- 
canUnlockAllTest if a specific user has the right to unlock all contents.- Parameters:
- user- the user.
- Returns:
- true if the user has the right to unlock all contents, false otherwise.
 
- 
unlockOrLockUnlock or lock contents- Parameters:
- contents- the contents to unlock or lock
- mode- the mode ('lock' or 'unlock')
- Returns:
- the result JSON map
 
- 
unlockUnlock contents- Parameters:
- contents- The ids of contents to unlock
- Returns:
- the result JSON map
 
- 
lockLock contents- Parameters:
- contents- The ids of contents to lock
- Returns:
- the result JSON map
 
 
-