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 Summary
FieldsModifier 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 Summary
Constructors -
Method Summary
Modifier 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.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
The component role. -
UNLOCK_ALL_RIGHT
The "unlock all" right ID.- See Also:
-
_rightManager
The rights manager -
_resolver
The Ametys object resolver -
_currentUserProvider
The current user provider. -
_userHelper
Helper for users -
_contentHelper
The content helper
-
-
Constructor Details
-
LockContentManager
public LockContentManager()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
canUnlock
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.- Parameters:
object- the locked object to test.- Returns:
- true if the current user can unlock the given locked object, false otherwise.
-
canUnlock
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.- Parameters:
object- the locked object to test.user- the user.- Returns:
- true if the current user can unlock the given locked object, false otherwise.
-
canUnlockAll
Test 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.
-
canUnlockAll
Test 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.
-
unlockOrLock
Unlock or lock contents- Parameters:
contents- the contents to unlock or lockmode- the mode ('lock' or 'unlock')- Returns:
- the result JSON map
-
unlock
Unlock contents- Parameters:
contents- The ids of contents to unlock- Returns:
- the result JSON map
-
lock
Lock contents- Parameters:
contents- The ids of contents to lock- Returns:
- the result JSON map
-