Class Access

java.lang.Object
de.elo.ix.jscript.Access

public class Access extends 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
    Constructor for object creation in Javascript.
    Deprecated.
    This constructor is for internal use only.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkAccess(Object obj, int lur)
    This function checks whether the current user has at least one of the given access permissions for the object.
    findUser(Object idOrGuidOrName)
    Find the UserInfo object for the given user ID, GUID or name.
    boolean
    hasFlag(Object user, Number flags)
    Returns true, if the user has at least one of the given flags.
    boolean
    hasFlag2(Object user, Number flags2)
    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
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 public Access(IAccessHandler handler)
      Deprecated.
      This constructor is for internal use only.
      Internally used constructor.
      Parameters:
      handler - Function calls are delegated to this object.
  • Method Details

    • findUser

      public UserInfo findUser(Object idOrGuidOrName)
      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(Object user, Number flags)
      Returns true, if the user has at least one of the given flags. If parameter user is an ID, GUID or name, the flags inclusive the inherited flags from groups or substituted users are taken into account. If parameter user is an UserInfo object, only the flags contained in the object are tested.
      Parameters:
      user - UserInfo object, ID, GUID, name or operating system name
      flags - flags to test
      Returns:
      true, if (UserInfo.flags & flags) != 0
    • hasFlag2

      public boolean hasFlag2(Object user, 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 name
      flags2 - flags to test
      Returns:
      true, if (UserInfo.flagss & flagss) != 0
      See Also:
    • isAdmin

      public boolean isAdmin(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:
    • isIgnoreAcl

      public boolean isIgnoreAcl(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:
    • isMemberOf

      public boolean isMemberOf(Object user, Object group)
      Checks the membership of an user in a group.
      Parameters:
      user - UserInfo object, ID, GUID, name or operating system name
      group - UserInfo object, ID, GUID, name or operating system name
      Returns:
      true, if the user is member of the group.
      See Also:
    • checkAccess

      public boolean checkAccess(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: