public class LockContentManager extends AbstractLogEnabled implements Serviceable, Component
| Modifier and Type | Field and Description | 
|---|---|
protected ContentHelper | 
_contentHelper
The content helper 
 | 
protected CurrentUserProvider | 
_currentUserProvider
The current user provider. 
 | 
protected AmetysObjectResolver | 
_resolver
The Ametys object resolver 
 | 
protected RightManager | 
_rightManager
The rights manager 
 | 
static String | 
ROLE
The component role. 
 | 
static String | 
UNLOCK_ALL_RIGHT
The "unlock all" right ID. 
 | 
| Constructor and Description | 
|---|
LockContentManager()  | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
canUnlock(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.  | 
boolean | 
canUnlock(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.  | 
boolean | 
canUnlockAll()
Test if the current user has the right to unlock all contents. 
 | 
boolean | 
canUnlockAll(UserIdentity user)
Test if a specific user has the right to unlock all contents. 
 | 
protected Map<String,Object> | 
lock(List<String> contents)
Lock contents 
 | 
void | 
service(ServiceManager smanager)  | 
protected Map<String,Object> | 
unlock(List<String> contents)
Unlock contents 
 | 
Map<String,Object> | 
unlockOrLock(List<String> contents,
            String mode)
Unlock or lock contents 
 | 
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerpublic static final String UNLOCK_ALL_RIGHT
protected RightManager _rightManager
protected AmetysObjectResolver _resolver
protected CurrentUserProvider _currentUserProvider
protected ContentHelper _contentHelper
public LockContentManager()
public void service(ServiceManager smanager) throws ServiceException
service in interface ServiceableServiceExceptionpublic boolean canUnlock(LockAwareAmetysObject object)
object - the locked object to test.public boolean canUnlock(LockAwareAmetysObject object, UserIdentity user)
object - the locked object to test.user - the user.public boolean canUnlockAll()
public boolean canUnlockAll(UserIdentity user)
user - the user.public Map<String,Object> unlockOrLock(List<String> contents, String mode)
contents - the contents to unlock or lockmode - the mode ('lock' or 'unlock')protected Map<String,Object> unlock(List<String> contents)
contents - The ids of contents to unlock