# RHUser

Inherits from: RHObject :: RHWrapper :: RHPrimaryKey

# Class Methods

# Inherited methods

Destructor ErrorAssoc OKAssoc

# CreateGroup

function Assoc CreateGroup(Object prgCtx, String groupName, Integer groupType=UAPI.GROUP, Integer leaderID=Undefined)

# CreateUser

function Assoc CreateUser(Object prgCtx, String userName, String password, Dynamic defaultGroup, Integer privs, String firstName=Undefined, String lastName=Undefined)

A class function for creating a new user. Needs some work.

# ID

function Integer ID()

Returns the ID of this user or group.

# New

function Frame New(Object prgCtx, Dynamic user=prgCtx.USession().fUserId)

# Overrides:

New in class RHObject

# NewRMGroup

function Frame NewRMGroup(Object prgCtx)

# Instance Methods

# Property Methods

Property methods can be accessed with the valueForKey method.

__deprecated__appliedrights _incomplete_projects allmembers allmemberships cachekey canlogin classidentifier classname clone department displayname email emailformatted errorassoc favorites favourites fullname gif group hasalterprivileges hash id identityhashcode img isadmin isdeleted isexternal isexternallyauthenticated isfactory isgroup isgrouporrole ismember isprojectrole isrecordsmanager isrole isuser isvalid iterator language lastlogin leader locale mayreallydelete members memberships membershipsquery metadata metadatatype methods name notifications okassoc ownednodes owner ownerid personalworkspace photo photourl pk privileges propertymethods proxy rec resetsubclass rightslist rightslistsql rolenode serialize string touch type userdata userid userpwd userrec webnodesview

# Inherited methods

assert cacheKey cacheKeyTouch cacheMethod cacheValueForKey callSuper checkError class classIdentifier className clone deserialize dict endTrans identityHashCode isAccessorMethod isCached isEqual isInstanceOf isProperty isPropertyMethod isPropertyRelated iterator lrucacheGet lrucacheSet memcachedDelete memcachedGet memcachedGetValue memcachedSet metadata metadataDelete metadataGet metadataSet methods model_get model_set pluck prepareForReuse propertyMethods removeFromCache reset resetCache resolveRelatedProperty respondsTo setCacheValueForKey setValueForKey setValueForKeyPath startTrans super valueForKey valueForKeyPath

# addMembers

function Assoc addMembers(Dynamic ids)

Adds a list of users or groups to this group or role. An error is returned if if a user or group is already a member of this group or role.

This function will lock a row in KState related to the user's group memberships. This lock will prevent the user from performing requests until the transaction completes, which is problematic for long running transactions. For such cases consider using addMembersDeferred() instead.

# Parameters
  • ids - A list of usernames, IDs, or RHUser objects.
# Returns
  • A return value Assoc.

# addMembersDeferred

function Assoc addMembersDeferred(Dynamic ids)

Adds a list of users or groups to this group or role. This function is a little more forgiving than .addMembers() when a user is already a member of the group.

# Parameters
  • ids - A list of usernames, IDs, or RHUser objects.
# Returns
  • A return value Assoc.

# allmembers

function Frame allmembers()

Returns an Iterator with all direct and indirect members of this group.

# allmemberships

function Frame allmemberships()

Returns an Iterator with all direct and indirect memberships of this user or group.

# authenticationCookie

function String authenticationCookie()

# canLogin

function Boolean canLogin()

# delete

function Assoc delete(Boolean reallyDelete=false)

# department

function Frame department()

# displayName

function String displayName()

Returns the display name of this user with the format configured by Administrator.

# email

function String email()

# emailformatted

function String emailformatted()

# favorites

function Frame favorites()

# favourites

function Frame favourites()

# fullname

function String fullname()

Returns the user's first and last name concatenated with a space.

# gif

function String gif()

# group

function Frame group()

# hasAlterPrivileges

function Boolean hasAlterPrivileges(Dynamic userid=.fPrgCtx.USession().fUserID)

Returns true if the current user has alter permission on this user or group.

# hash

function String hash()

# Overrides:

hash in class RHObject

# hasPerm

function Boolean hasPerm(Dynamic DataID, Integer perm=DAPI.PERM_SEECONTENTS)

# hasPrivilege

function Boolean hasPrivilege(Integer privilege)

See UAPI.PRIV_* values in documentation.

# img

function String img()

# impersonate

function Object impersonate()

Returns a prgCtx for the current user. Use with care.

# isAdmin

function Boolean isAdmin()

# isDeleted

function Boolean isDeleted()

# isExternal

function Boolean isExternal()

# isExternallyAuthenticated

function Boolean isExternallyAuthenticated()

# isFactory

function Boolean isFactory()

Returns true if this object represents a factory group, false otherwise.

# isGroup

function Boolean isGroup()

Returns true if this object represents a group, false otherwise.

# isGroupOrRole

function Boolean isGroupOrRole()

Returns true if this object represents a group or role, false otherwise.

# isMember

function Boolean isMember(Dynamic userid=.fPrgCtx.USession().fUserID, Boolean recursive=true)

# isMemberOf

function Boolean isMemberOf(Dynamic groupID, Boolean recursive=true)

# isProjectRole

function Boolean isProjectRole()

Returns true if this group is a project role, false otherwise.

# isRecordsManager

function Boolean isRecordsManager()

Return true if Records Management is installed and the user is member of the Records Management group.

# isRole

function Boolean isRole()

Returns true if this group is a role, false otherwise.

# isUser

function Boolean isUser()

Tests if this RHUser represents a user.

# Returns
  • true if this object represents a user, false otherwise.

# isValid

function Boolean isValid()

# Overrides:

isValid in class RHPrimaryKey

# language

function String language()

Returns the language code for this user.

# lastlogin

function Date lastlogin()

Returns the last login date of this user as a date.

# leader

function Frame leader()

# locale

function String locale()

# mayReallyDelete

function Boolean mayReallyDelete()

# members

function Frame members()

Returns an Iterator with the direct members of this group.

# memberships

function Frame memberships()

Returns an Iterator with all direct memberships of this user or group.

# membershipsQuery

function Frame membershipsQuery()

This method returns an RHKUAFQuery with all groups the user is a member of (direct & indirect).

# metadataType

function Integer metadataType()

# Overrides:

metadataType in class RHPrimaryKey

# name

function String name()

# nodesACL

function Dynamic nodesACL(Dynamic aclTypes=DAPI.PERMTYPE_ACL, Boolean filterPermissions=true)

Returns all nodes on which the current user or group has direct access (i.e., not via a group membership)

This can include the default user, default group, and any ACL entries

# notifications

function Frame notifications()

# otcsticket

function String otcsticket()

# ownedNodes

function Frame ownedNodes()

# owner

function Frame owner()

# ownerid

function Integer ownerid()

Returns the owner id of this user or group.

# personalworkspace

function Frame personalworkspace()

Returns an RHNode of the user's Personal Workspace.

# photo

function Frame photo()

Returns an RHNode of the user's photo.

# photourl

function String photourl()

Returns the Pulse photo URL for this user.

# pk

function Integer pk()

# Overrides:

pk in class RHPrimaryKey

# pref

function Dynamic pref(String keyword, Dynamic defaultValue=Undefined)

The keyword parameter can also be a keypath in the event the value is an Assoc

# primitiveValueForKey

function Dynamic primitiveValueForKey(String key, Dynamic defaultValue=Undefined)

# Overrides:

primitiveValueForKey in class RHWrapper

# privileges

function Integer privileges()

# proxy

function Frame proxy(Integer proxyType=UAPI.PROXY_WAPI)

# rec

function Record rec()

This method is equivalent to userRec.

# removeMembers

function Assoc removeMembers(Dynamic ids)

# removeProxy

function Assoc removeProxy(Integer proxyType=UAPI.PROXY_WAPI)

# rename

function Assoc rename(String newName)

# resetSubclass

function Frame resetSubclass()

# Overrides:

resetSubclass in class RHObject

# rightsList

function List rightsList(Integer proxyType=CAPI.PROXY_NONE)

# rightsListSQL

function Dynamic rightsListSQL(Integer proxyType=CAPI.PROXY_NONE)

This function returns a String or List that can be injected into a query. This depends whether the system has the KUAFRightsListNew table.

# roleNode

function Frame roleNode()

# serialize

function Dynamic serialize()

# Overrides:

serialize in class RHObject

# setLeader

function Assoc setLeader(Dynamic newleaderid=Undefined)

A leader must also be a member of the group unless the leader and group are the same. This method handles both.

# setMembers

function Assoc setMembers(Dynamic ids)

Sets the members of this group or role to the list of users or groups. This will also remove any memberships that are not in the list of passed in users or groups.

# Parameters
  • ids - A list of usernames, IDs, or RHUser objects.
# Returns
  • A return value Assoc.

# setOwner

function Assoc setOwner(Dynamic ownerid)

# setPassword

function Assoc setPassword(String password)

# setProxy

function Assoc setProxy(Dynamic userid, Integer proxyType=UAPI.PROXY_WAPI)

# setValues

function Frame setValues(Dynamic values)

# Overrides:

setValues in class RHObject

# string

function String string()

This method returns a string representation of the object.

# Overrides:

string in class RHObject

# test

function Void test()

# test2

function Void test()

# testPassword

function Boolean testPassword(String password)

# touch

function Assoc touch()

Touching a role will force the associated node to get touched as well.

# Overrides:

touch in class RHWrapper

# type

function Integer type()

Returns the user type as an integer, where:

  • 0 denotes a user

  • 1 denotes group

  • 3 denotes a system group

  • 4 denotes a system privilege group

  • 8 denotes an external user

  • 9 denotes an external group

  • 2000 or greater denotes a role (e.g., project roles)

# userdata

function Assoc userdata()

# userid

function Integer ID()

Returns the id of this user or group.

# userpwd

function String userpwd()

This method returns an error since access to the password is not allowed.

# userRec

function Record userRec()

Returns a Record representation of this user based on the KUAF table.

# webNodesView

function String webNodesView()

Last Updated: 7/19/2019, 3:06:36 PM