Package de.elo.ix.jscript
Class Access
java.lang.Object
de.elo.ix.jscript.Access
public class Access
extends java.lang.Object
Check user permissions and group membership.
This class can only be used in IX scripting on the server side.
-
Constructor Summary
Constructors Constructor Description Access()
Constructor for object creation in Javascript.Access(IAccessHandler handler)
Deprecated.This constructor is for internal use only. -
Method Summary
Modifier and Type Method Description boolean
checkAccess(java.lang.Object obj, int lur)
This function checks whether the current user has at least one of the given access permissions for the object.UserInfo
findUser(java.lang.Object idOrGuidOrName)
Find the UserInfo object for the given user ID, GUID or name.boolean
hasFlag(java.lang.Object user, java.lang.Number flags)
Returns true, if the user has at least one of the given flags.boolean
hasFlag2(java.lang.Object user, java.lang.Number flags2)
Returns true, if the user has at least one of the given flags in the second bitset.boolean
isAdmin(java.lang.Object user)
Returns true, if the user has at least one of the given flags in the second bitset.boolean
isIgnoreAcl(java.lang.Object user)
Returns true, if the user has at least one of the given flags in the second bitset.boolean
isMemberOf(java.lang.Object user, java.lang.Object group)
Checks the membership of an user in a group.
-
Constructor Details
-
Access
public Access()Constructor for object creation in Javascript. Example:function RF_isAdmin(ec, args) { var acc = ec.getAccess(); var userInfo = acc.findUser(123); var isAdmin = acc.isAdmin(userInfo); return isAdmin; }
-
Access
Deprecated.This constructor is for internal use only.Internally used constructor.- Parameters:
handler
- Function calls are delegated to this object.
-
-
Method Details
-
findUser
Find the UserInfo object for the given user ID, GUID or name. The returned object contains all groups and flags inhertited from groups or substituted users.- Parameters:
idOrGuidOrName
- ID, GUID, ELO name or operating sytem name- Returns:
- UserInfo object or null, if the user cannot be found.
-
hasFlag
public boolean hasFlag(java.lang.Object user, java.lang.Number flags)Returns true, if the user has at least one of the given flags. If parameteruser
is an ID, GUID or name, the flags inclusive the inherited flags from groups or substituted users are taken into account. If parameteruser
is an UserInfo object, only the flags contained in the object are tested.- Parameters:
user
- UserInfo object, ID, GUID, name or operating system nameflags
- flags to test- Returns:
- true, if (UserInfo.flags & flags) != 0
-
hasFlag2
public boolean hasFlag2(java.lang.Object user, java.lang.Number flags2)Returns true, if the user has at least one of the given flags in the second bitset.- Parameters:
user
- UserInfo object, ID, GUID, name or operating system nameflags2
- flags to test- Returns:
- true, if (UserInfo.flagss & flagss) != 0
- See Also:
hasFlag(Object, Number)
-
isAdmin
public boolean isAdmin(java.lang.Object user)Returns true, if the user has at least one of the given flags in the second bitset.- Parameters:
user
- UserInfo object, ID, GUID, name or operating system name- Returns:
- true, if (UserInfo.flagss & AccessC.FLAG_ADMIN) != 0
- See Also:
hasFlag(Object, Number)
-
isIgnoreAcl
public boolean isIgnoreAcl(java.lang.Object user)Returns true, if the user has at least one of the given flags in the second bitset.- Parameters:
user
- UserInfo object, ID, GUID, name or operating system name- Returns:
- true, if (UserInfo.flagss & AccessC.FLAG_IGNOREACL) != 0
- See Also:
hasFlag(Object, Number)
-
isMemberOf
public boolean isMemberOf(java.lang.Object user, java.lang.Object group)Checks the membership of an user in a group.- Parameters:
user
- UserInfo object, ID, GUID, name or operating system namegroup
- UserInfo object, ID, GUID, name or operating system name- Returns:
- true, if the user is member of the group.
- See Also:
hasFlag(Object, Number)
-
checkAccess
public boolean checkAccess(java.lang.Object obj, int lur)This function checks whether the current user has at least one of the given access permissions for the object. Only the ACL and the workflow access extension is checked. This function does not invoke the server event script IXServerEvents.checkSordAcces.- Parameters:
obj
- Object to be accessed. Currently only Sord objects are accepted.lur
- Combination of AccessC.LUR_* constants.- Returns:
- true, if access is granted. false, if access is denied.
- See Also:
AccessC
,IXServerEvents.onCheckSordAccess(de.elo.ix.client.IXServerEventsContext, Sord, de.elo.ix.client.SordZ, int, de.elo.ix.client.CheckAccessOptions)
-