Represents a single user account as a node in the WebDAV resource tree, served under a users folder such as /users/{userId}/. Exposes the user's profile fields, group memberships, roles, owned repositories, calendars and address books, and mail inbox, and backs the CalDAV, CardDAV and WebDAV principal behaviour for that account. A GET on this resource renders the user's dashboard page; child resources include the user's repositories and any browseable pages registered by installed applications.
Group: Resources
Extends: AbstractCollectionResource
Implements: CollectionResource, UserAdminResource, MakeCollectionableResource, PropFindableResource, GetableResource, PrincipalResource, Mailbox, CalDavPrincipal, CardDavPrincipal, ProfileResource, RepositoriesHome
Properties
| Property | Returns | Description |
|---|---|---|
| accessControlList | Map<Principal,List<Priviledge>> | The WebDAV access control list for this resource. Note that the underlying privilege population is currently disabled, so the returned map always contains a single entry for this resource mapped to an empty privilege list. |
| activeMenuIds | String[] | The IDs of admin menu items that should be shown as active when this resource is being viewed. Always returns an empty array. |
| address | String | The href of this user's address books folder, used as this principal's CardDAV address. |
| addressBookHomeSet | HrefList | The CardDAV address book home set for this user: a single-entry list containing the href of this user's address books folder. |
| allFields | Map<String,String> | A map of all custom fields stored against this profile across all of its group memberships, keyed on field name. Where more than one membership has a field with the same name, only one of the values is kept. The result is computed on first access and cached on this resource instance. |
| calendarHomeSet | HrefList | The CalDAV calendar home set for this user: a single-entry list containing the href of this user's Calendars folder. |
| calendarUserAddressSet | HrefList | The CalDAV calendar user address set for this user: a single-entry list containing this resource's own href. |
| calendarUserType | String | The CalDAV calendar user type for this principal. Always returns "INDIVIDUAL". |
| children | ResourceList<CommonResource> | The child resources of this user: a branch folder for each repository the user owns, plus any browseable pages contributed by installed applications. The list is built once and cached for the lifetime of this resource instance. |
| createDate | Date | The date and time this user's profile was first created. |
| currentUserRoles | Set<Role> | All roles currently granted to this user within the current organisation. Computed on first access and cached on this resource instance. |
| directoryTemplate | String | The template used to render this user's directory listing view in the admin file manager. |
String | The user's email address. | |
| emailDisabled | boolean | Whether incoming mail delivery is disabled for this user. Always returns false. |
| extProfileBean | ExtProfileBean | An extended bean representation of this user's profile, with additional fields beyond getProfile, built on first access and cached on this resource instance. |
| firstName | String | The user's first (given) name. |
| formattedName | String | Display name for this user: their first and last name combined (whichever parts are set), falling back to their nickname, and finally to their account name if neither is set. |
| hasPassword | boolean | Whether this account has at least one password credential set. |
| idenitifer | PrincipleId | The principal identifier for this user, which is the href (URL path) to this resource. |
| inbox | MessageFolder | This user's inbox folder, resolved as the "inbox" child of this resource. Returns null if there is no inbox child, or if the child exists but is not a message folder. |
| lastVisit | Date | The date of this user's most recent access to the current website. Resolved by querying the access log service on first access and cached on this resource instance. |
| memberships | MembershipList | All of this user's group memberships within the current organisation and its descendants. The result is cached against this resource instance and read from a shared cache on first access. |
| modifiedDate | Date | The date and time this user's profile was last updated. Set automatically on save, so effectively never null for a persisted profile. |
| name | String | The user name, which is this account's unique login identifier and also the path segment used to address this resource in the WebDAV tree. |
| nickName | String | The user's nickname, falling back to their first name, and then to their account name, if no nickname is set. There is no uniqueness constraint on this value. |
| parent | CommonCollectionResource | The collection resource this user is a child of - the users folder for the current organisation. |
| phone | String | The user's phone number. |
| primaryMembership | MembershipBean | The first of this user's primary group memberships. Returns null if the user has no primary group membership. |
| primaryMemberships | MembershipList | All of this user's memberships that are flagged as a primary group membership. |
| profile | ProfileBean | A bean representation of this user's profile, built on first access and cached on this resource instance. |
| profilePicHref | String | The href to this user's profile picture: a hash-addressed file URL if a photo has been uploaded, otherwise the default profile picture theme asset. |
| repositories | List<BranchFolder> | The repositories (source code / content branches) owned by this user, filtered from the resource's child list. Building the list does the same work as reading the children, since it walks them looking for branch folders. |
| signatureCredentials | Map<String,SignatureCredentialBean> | This user's stored signature credentials for the current website, keyed on credential source. Computed on first access and cached on this resource instance. |
| supportedComponentSets | SupportedCalendarComponentListsSet | The set of supported CalDAV calendar component types for this principal. Always returns null. |
| surName | String | The user's surname (family name). |
| thisEntity | BaseEntity | The base entity this resource represents, which is the same profile as getThisProfile. |
| thisProfile | Profile | The profile entity this resource represents, same as getThisUser. |
| thisUser | Profile | The profile entity this resource represents. |
| title | String | Display title for this resource, used as the page title. This is the user's first and last name combined (whichever parts are set), falling back to their nickname, and finally to their user name if neither is set. |
| userId | Long | The numeric database ID of this user's profile. Always unique. |
Methods
getTitle() · getRepositories() · getChildren() · getName() · createCollectionNoTx(String newName) · getCreateDate() · getModifiedDate() · getParent() · getIdenitifer() · getCalendarHomeSet() · getCalendarUserAddressSet() · getAddressBookHomeSet() · getAddress() · getAccessControlList() · getThisUser() · getInbox() · isEmailDisabled() · getNickName() · getUserId() · getThisProfile() · getThisEntity() · getFormattedName() · getSupportedComponentSets() · isInGroup(String groupName) · isInGroup(String groupName, String orgId) · isInGroup(Group group) · getPrimaryMembership() · getPrimaryMemberships() · is(String type) · getMemberships() · memberships(String groupName) · getCalendarUserType() · getProfile() · getExtProfileBean() · getCurrentUserRoles() · hasRole(Role role) · hasRole(String roleName) · getAllFields() · getSurName() · getFirstName() · getEmail() · getProfilePicHref() · getLastVisit() · dailyVisits(Date from, Date to) · dailyVisits(Website website) · dailyVisits(Date from, Date to, Website website) · searchWebHits() · searchWebHits(Date from, Date to) · getSignatureCredentials() · isHasPassword() · getPhone() · setFirstName(String s) · setSurname(String s) · setEmail(String s) · setPhone(String s) · setPhotoHash(String s) · setNickName(String s) · save() · getDirectoryTemplate() · getActiveMenuIds()
getTitle()
Returns: String
Display title for this resource, used as the page title. This is the user's first and last name combined (whichever parts are set), falling back to their nickname, and finally to their user name if neither is set.
getRepositories()
Returns: List<BranchFolder>
The repositories (source code / content branches) owned by this user, filtered from the resource's child list. Building the list does the same work as reading the children, since it walks them looking for branch folders.
getChildren()
Returns: ResourceList<CommonResource>
The child resources of this user: a branch folder for each repository the user owns, plus any browseable pages contributed by installed applications. The list is built once and cached for the lifetime of this resource instance.
getName()
Returns: String
The user name, which is this account's unique login identifier and also the path segment used to address this resource in the WebDAV tree.
createCollectionNoTx(String newName)
Returns: CollectionResource
Creates a new repository owned by this user without opening a database transaction, so the caller must already have one active. Used internally to provision repositories such as a user's certificates branch.
| Parameter | Description |
|---|---|
newName | the name of the new repository to create |
getCreateDate()
Returns: Date
The date and time this user's profile was first created.
getModifiedDate()
Returns: Date
The date and time this user's profile was last updated. Set automatically on save, so effectively never null for a persisted profile.
getParent()
Returns: CommonCollectionResource
The collection resource this user is a child of - the users folder for the current organisation.
getIdenitifer()
Returns: PrincipleId
The principal identifier for this user, which is the href (URL path) to this resource.
getCalendarHomeSet()
Returns: HrefList
The CalDAV calendar home set for this user: a single-entry list containing the href of this user's Calendars folder.
getCalendarUserAddressSet()
Returns: HrefList
The CalDAV calendar user address set for this user: a single-entry list containing this resource's own href.
getAddressBookHomeSet()
Returns: HrefList
The CardDAV address book home set for this user: a single-entry list containing the href of this user's address books folder.
getAddress()
Returns: String
The href of this user's address books folder, used as this principal's CardDAV address.
getAccessControlList()
Returns: Map<Principal,List<Priviledge>>
The WebDAV access control list for this resource. Note that the underlying privilege population is currently disabled, so the returned map always contains a single entry for this resource mapped to an empty privilege list.
getThisUser()
Returns: Profile
The profile entity this resource represents.
getInbox()
Returns: MessageFolder
This user's inbox folder, resolved as the "inbox" child of this resource. Returns null if there is no inbox child, or if the child exists but is not a message folder.
isEmailDisabled()
Returns: boolean
Whether incoming mail delivery is disabled for this user. Always returns false.
getNickName()
Returns: String
The user's nickname, falling back to their first name, and then to their account name, if no nickname is set. There is no uniqueness constraint on this value.
getUserId()
Returns: Long
The numeric database ID of this user's profile. Always unique.
getThisProfile()
Returns: Profile
The profile entity this resource represents, same as getThisUser.
getThisEntity()
Returns: BaseEntity
The base entity this resource represents, which is the same profile as getThisProfile.
getFormattedName()
Returns: String
Display name for this user: their first and last name combined (whichever parts are set), falling back to their nickname, and finally to their account name if neither is set.
getSupportedComponentSets()
Returns: SupportedCalendarComponentListsSet
The set of supported CalDAV calendar component types for this principal. Always returns null.
isInGroup(String groupName)
Returns: boolean
Checks whether the user has a membership, in the organisation currently being accessed or one of its children, to the group with the given name.
| Parameter | Description |
|---|---|
groupName | the name of the group to check membership of |
isInGroup(String groupName, String orgId)
Returns: boolean
Checks whether the user has a membership to the group with the given name, within the organisation identified by the given organisation ID.
| Parameter | Description |
|---|---|
groupName | the name of the group to check membership of |
orgId | the ID of the organisation to check membership within |
isInGroup(Group group)
Returns: boolean
Checks whether the user has a membership to the given group.
| Parameter | Description |
|---|---|
group | the group to check membership of |
getPrimaryMembership()
Returns: MembershipBean
The first of this user's primary group memberships. Returns null if the user has no primary group membership.
getPrimaryMemberships()
Returns: MembershipList
All of this user's memberships that are flagged as a primary group membership.
is(String type)
Returns: boolean
Checks the resource type of this resource. Returns true for the type name "user", and otherwise delegates to the superclass check.
| Parameter | Description |
|---|---|
type | the resource type name to check |
getMemberships()
Returns: MembershipList
All of this user's group memberships within the current organisation and its descendants. The result is cached against this resource instance and read from a shared cache on first access.
memberships(String groupName)
Returns: MembershipList
This user's memberships filtered down to those in the group with the given name.
| Parameter | Description |
|---|---|
groupName | the name of the group to filter memberships by |
getCalendarUserType()
Returns: String
The CalDAV calendar user type for this principal. Always returns "INDIVIDUAL".
getProfile()
Returns: ProfileBean
A bean representation of this user's profile, built on first access and cached on this resource instance.
getExtProfileBean()
Returns: ExtProfileBean
An extended bean representation of this user's profile, with additional fields beyond getProfile, built on first access and cached on this resource instance.
getCurrentUserRoles()
Returns: Set<Role>
All roles currently granted to this user within the current organisation. Computed on first access and cached on this resource instance.
hasRole(Role role)
Returns: boolean
Checks whether this user holds the given role within the current organisation.
| Parameter | Description |
|---|---|
role | the role to check, may be null |
hasRole(String roleName)
Returns: boolean
Checks whether this user holds a role with the given name within the current organisation.
| Parameter | Description |
|---|---|
roleName | the name of the role to check, may be null or blank |
getAllFields()
Returns: Map<String,String>
A map of all custom fields stored against this profile across all of its group memberships, keyed on field name. Where more than one membership has a field with the same name, only one of the values is kept. The result is computed on first access and cached on this resource instance.
getSurName()
Returns: String
The user's surname (family name).
getFirstName()
Returns: String
The user's first (given) name.
getEmail()
Returns: String
The user's email address.
getProfilePicHref()
Returns: String
The href to this user's profile picture: a hash-addressed file URL if a photo has been uploaded, otherwise the default profile picture theme asset.
getLastVisit()
Returns: Date
The date of this user's most recent access to the current website. Resolved by querying the access log service on first access and cached on this resource instance.
dailyVisits(Date from, Date to)
Returns: List<DayStat>
The number of hits for each day this user visited the current website, within the given date range.
| Parameter | Description |
|---|---|
from | the start of the date range to count visits for |
to | the end of the date range to count visits for |
dailyVisits(Website website)
Returns: List<DayStat>
The number of hits for each day this user visited the given website, over the common reporting date range currently in effect.
| Parameter | Description |
|---|---|
website | the website to count visits for |
dailyVisits(Date from, Date to, Website website)
Returns: List<DayStat>
The number of hits for each day this user visited the given website, within the given date range. This is the implementation used by the other dailyVisits overloads.
| Parameter | Description |
|---|---|
from | the start of the date range to count visits for |
to | the end of the date range to count visits for |
website | the website to count visits for |
searchWebHits()
Returns: KSearchResponse
Searches for this user's web hits over the common reporting date range currently in effect, returning up to 10000 results.
searchWebHits(Date from, Date to)
Returns: KSearchResponse
Searches for this user's web hits within the given date range, returning up to 10000 results.
| Parameter | Description |
|---|---|
from | the start of the date range to search |
to | the end of the date range to search |
getSignatureCredentials()
Returns: Map<String,SignatureCredentialBean>
This user's stored signature credentials for the current website, keyed on credential source. Computed on first access and cached on this resource instance.
isHasPassword()
Returns: boolean
Whether this account has at least one password credential set.
getPhone()
Returns: String
The user's phone number.
setFirstName(String s)
Returns: void
Sets the user's first (given) name. Call save to persist the change.
| Parameter | Description |
|---|---|
s | the new first name |
setSurname(String s)
Returns: void
Sets the user's surname (family name). Call save to persist the change.
| Parameter | Description |
|---|---|
s | the new surname |
setEmail(String s)
Returns: void
Sets the user's email address. Call save to persist the change.
| Parameter | Description |
|---|---|
s | the new email address |
setPhone(String s)
Returns: void
Sets the user's phone number. Call save to persist the change.
| Parameter | Description |
|---|---|
s | the new phone number |
setPhotoHash(String s)
Returns: void
Sets the hash identifying this user's uploaded profile picture file. Call save to persist the change.
| Parameter | Description |
|---|---|
s | the new photo hash |
setNickName(String s)
Returns: void
Sets the user's nickname. Call save to persist the change.
| Parameter | Description |
|---|---|
s | the new nickname |
save()
Returns: void
Apply any changes to persistence. Does not use a transaction, so you must have started a transaction already. This will update the search index so should be done last to ensure the transaction is not rolled back
getDirectoryTemplate()
Returns: String
The template used to render this user's directory listing view in the admin file manager.
getActiveMenuIds()
Returns: String[]
The IDs of admin menu items that should be shown as active when this resource is being viewed. Always returns an empty array.