Class LockContentManager

All Implemented Interfaces:
Component, LogEnabled, Serviceable

Unlock or lock one or several content(s)
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager smanager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • canUnlock

      public 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.
      Parameters:
      object - the locked object to test.
      Returns:
      true if the current user can unlock the given locked object, false otherwise.
    • canUnlock

      public 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.
      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

      public boolean 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

      public boolean canUnlockAll(UserIdentity user)
      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

      public Map<String,Object> unlockOrLock(List<String> contents, String mode)
      Unlock or lock contents
      Parameters:
      contents - the contents to unlock or lock
      mode - the mode ('lock' or 'unlock')
      Returns:
      the result JSON map
    • unlock

      protected Map<String,Object> unlock(List<String> contents)
      Unlock contents
      Parameters:
      contents - The ids of contents to unlock
      Returns:
      the result JSON map
    • lock

      protected Map<String,Object> lock(List<String> contents)
      Lock contents
      Parameters:
      contents - The ids of contents to lock
      Returns:
      the result JSON map