Package de.elo.ix.jscript
Class Access
java.lang.Object
de.elo.ix.jscript.Access
Check user permissions and group membership. This class can only be used in IX scripting on the
server side.
-
Constructor Summary
ConstructorsConstructorDescriptionAccess()
Constructor for object creation in Javascript.Access
(IAccessHandler handler) Deprecated.This constructor is for internal use only. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkAccess
(Object obj, int lur) This function checks whether the current user has at least one of the given access permissions for the object.Find the UserInfo object for the given user ID, GUID or name.boolean
Returns true, if the user has at least one of the given flags.boolean
Returns true, if the user has at least one of the given flags in the second bitset.boolean
Returns true, if the user has at least one of the given flags in the second bitset.boolean
isIgnoreAcl
(Object user) Returns true, if the user has at least one of the given flags in the second bitset.boolean
isMemberOf
(Object user, 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
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
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:
-
isAdmin
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:
-
isIgnoreAcl
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:
-
isMemberOf
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:
-
checkAccess
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:
-