Enum DocumentLockingHelper
- java.lang.Object
-
- java.lang.Enum<DocumentLockingHelper>
-
- net.anotheria.asg.util.locking.helper.DocumentLockingHelper
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<DocumentLockingHelper>
public enum DocumentLockingHelper extends java.lang.Enum<DocumentLockingHelper>
Current Helper only checks permission for action on LockableObject. Actually should be used in CMS actions - as additional permission checker.- Version:
- $Id: $Id
- Author:
- h3llka, another
-
-
Enum Constant Summary
Enum Constants Enum Constant Description containerDeleteContainerDelete action.containerListAddRowContainerListAddRow - action.containerListQuickAddContainerListQuickAdd - action.containerMoveContainerMove action.containerTableAddActionContainerTableAddAction - action.copyLangCopyLang action.createCreate action.deleteDelete action.duplicateDuplicate action.editEdit action.linksToMeLinksToMe action.lockLock - action.multiLanguageSwitchMultilanguageSwitch action.newDocNew action.searchSearch action.showShow action.unLockUnLock - action.updateUpdate action.versionInfoVersionInfo action.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckExecutionPermission(LockableObject document, boolean userInAdminRole, java.lang.String currentUser)Allows additional permissions check.static DocumentLockingHelpervalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static DocumentLockingHelper[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
show
public static final DocumentLockingHelper show
Show action. Actually allowed for all logged in users.
-
search
public static final DocumentLockingHelper search
Search action. Actually allowed for all logged in users.
-
linksToMe
public static final DocumentLockingHelper linksToMe
LinksToMe action. Actually allowed for all logged in users.
-
duplicate
public static final DocumentLockingHelper duplicate
Duplicate action. Actually allowed for all logged in users.
-
create
public static final DocumentLockingHelper create
Create action. Actually allowed for all logged in users.
-
update
public static final DocumentLockingHelper update
Update action. If document is locked - only locker - can perform current operation !!! Otherwise RuntimeException should be thrown.
-
delete
public static final DocumentLockingHelper delete
Delete action. If document is locked - only locker - can perform current operation !!! Otherwise RuntimeException should be thrown.
-
edit
public static final DocumentLockingHelper edit
Edit action. Actually - edit just opens edit - view. So should be allowed for all users.
-
newDoc
public static final DocumentLockingHelper newDoc
New action. - Similar to Create action. Actually allowed for all logged in users.
-
lock
public static final DocumentLockingHelper lock
Lock - action. Lock can't be performed on all ready locked objects!
-
unLock
public static final DocumentLockingHelper unLock
UnLock - action. UnLock can be performed only on locked document. Only "admin" or locker - can execute current action.
-
multiLanguageSwitch
public static final DocumentLockingHelper multiLanguageSwitch
MultilanguageSwitch action. Actualy very similar to Update action. For locked document can be executed only by locker.
-
copyLang
public static final DocumentLockingHelper copyLang
CopyLang action. Actualy very similar to Update action. For locked document can be executed only by locker.
-
versionInfo
public static final DocumentLockingHelper versionInfo
VersionInfo action. Can be executed by everyOne!
-
containerDelete
public static final DocumentLockingHelper containerDelete
ContainerDelete action. Similar to Delete action - but actually used for linked entries deletion. In current case - Document updation will be invoked!!! If document is locked - only locker - can perform current operation !!! Otherwise RuntimeException should be thrown.
-
containerMove
public static final DocumentLockingHelper containerMove
ContainerMove action. In current case - Document updation will be invoked!!! If document is locked - only locker - can perform current operation !!! Otherwise RuntimeException should be thrown.
-
containerListAddRow
public static final DocumentLockingHelper containerListAddRow
ContainerListAddRow - action. In current case - Document updation will be invoked!!! If document is locked - only locker - can perform current operation !!! Otherwise RuntimeException should be thrown.
-
containerTableAddAction
public static final DocumentLockingHelper containerTableAddAction
ContainerTableAddAction - action. In current case - Document updation will be invoked!!! If document is locked - only locker - can perform current operation !!! Otherwise RuntimeException should be thrown.
-
containerListQuickAdd
public static final DocumentLockingHelper containerListQuickAdd
ContainerListQuickAdd - action. In current case - Document updation will be invoked!!! If document is locked - only locker - can perform current operation !!! Otherwise RuntimeException should be thrown.
-
-
Method Detail
-
values
public static DocumentLockingHelper[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DocumentLockingHelper c : DocumentLockingHelper.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DocumentLockingHelper valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
checkExecutionPermission
public void checkExecutionPermission(LockableObject document, boolean userInAdminRole, java.lang.String currentUser)
Allows additional permissions check. RuntimeException will be thrown if action can't be performed.- Parameters:
document- - actually LockableObject instanceuserInAdminRole- - is user in "admin" role, actually for unlock operation onlycurrentUser- - current user id
-
-