Class LockContentManager

    • Method Detail

      • 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,​ObjectunlockOrLock​(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,​Objectunlock​(List<String> contents)
        Unlock contents
        Parameters:
        contents - The ids of contents to unlock
        Returns:
        the result JSON map
      • lock

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