Package jetbrains.buildServer.users
Interface SUser
-
- All Superinterfaces:
AuthorityHolder
,jetbrains.buildServer.log.Loggable
,NotificationRulesHolder
,PropertyHolder
,RolesHolder
,User
public interface SUser extends AuthorityHolder, RolesHolder, User, NotificationRulesHolder
Presents TeamCity user data.
-
-
Field Summary
Fields Modifier and Type Field Description static int
GUEST_USER_ID
Special user ids, moved from UserFactoryImplstatic int
SUPER_USER_ID
static int
UKNOWN_USER_ID
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteUserProperty(PropertyKey propertyKey)
Deletes a property with specified key from the user profile.java.util.List<SVcsModification>
getAllModifications()
Returns the list of all (personal and non-personal) user modifications sorted by VCS date.java.util.List<UserGroup>
getAllUserGroups()
Returns the list of all user groups that include this user, directly or through intermediate subgroups.java.lang.String
getBlockState(java.lang.String blockType)
Retrieves state of a block stored for this userjava.util.Collection<SBuildType>
getBuildTypesOrder(SProject project)
java.util.List<SBuildType>
getOrderedBuildTypes(SProject project)
Returns the list of build configurations (in a project, or globally) sorted according to user settings.java.util.List<java.lang.String>
getProjectsOrder()
java.util.List<UserGroup>
getUserGroups()
Returns the list of groups which this user belongs to.java.util.List<SVcsModification>
getVcsModifications(int numberOfActiveDays)
Returns the list of changes made by this user filtered according to the caller's permissions.java.util.List<VcsUsernamePropertyKey>
getVcsUsernameProperties()
Returns list of VCS username properties associated with this user.void
hideProject(java.lang.String projectId)
Marks a project with specified id as invisibleboolean
isGuest()
Returns true if the user is guestboolean
isHighlightRelatedDataInUI()
Returns true if highlighting of user changes, investigations, and other related data in web UI is enabled.void
setBlockState(java.lang.String blockType, java.lang.String blockState)
Stores collapsable block state for this uservoid
setBuildTypesOrder(SProject project, java.util.List<SBuildType> visible, java.util.List<SBuildType> invisible)
Sets visible and invisible build types for the given project in the specified order.void
setLastLoginTimestamp(java.util.Date timestamp)
Updates last login timestampvoid
setPassword(java.lang.String password)
Changes password of this uservoid
setProjectsOrder(java.util.List<java.lang.String> projectsOrder)
Sets order of the projects.void
setUserProperties(java.util.Map<? extends PropertyKey,java.lang.String> properties)
Updates properties of the user specified by user id.void
setUserProperty(PropertyKey propertyKey, java.lang.String value)
Sets a property with specified key and value in user profilevoid
setVisibleProjects(java.util.Collection<java.lang.String> visibleProjects)
Sets projects visible for specified uservoid
updateUserAccount(java.lang.String username, java.lang.String name, java.lang.String email)
Updates user fields: username, name and email.-
Methods inherited from interface jetbrains.buildServer.serverSide.auth.AuthorityHolder
getAllPermissions, getAssociatedUser, getGlobalPermissions, getPermissionsGrantedForAllProjects, getPermissionsGrantedForAnyOfProjects, getPermissionsGrantedForProject, getProjectsPermissions, hasAllPermissionsOf, isPermissionGrantedForAllProjects, isPermissionGrantedForAnyOfProjects, isPermissionGrantedForAnyProject, isPermissionGrantedForProject, isPermissionGrantedGlobally
-
Methods inherited from interface jetbrains.buildServer.notification.NotificationRulesHolder
addNewRule, applyOrder, findConflictingRules, findRuleById, getAllParentRulesHolders, getNotificationRules, getParentRulesHolders, removeRule, removeRule, setNotificationRules
-
Methods inherited from interface jetbrains.buildServer.users.PropertyHolder
getBooleanProperty, getProperties, getPropertyValue
-
Methods inherited from interface jetbrains.buildServer.serverSide.auth.RolesHolder
addRole, getAllParentHolders, getParentHolders, getRoles, getRolesWithScope, getScopes, isSystemAdministratorRoleGranted, isSystemAdministratorRoleGrantedDirectly, isSystemAdministratorRoleInherited, removeRole, removeRole, removeRoles
-
Methods inherited from interface jetbrains.buildServer.users.User
getAllProjects, getDescriptiveName, getEmail, getExtendedName, getId, getLastLoginTimestamp, getName, getRealm, getUsername, getVisibleProjects
-
-
-
-
Field Detail
-
GUEST_USER_ID
static final int GUEST_USER_ID
Special user ids, moved from UserFactoryImpl- Since:
- 2023.03
- See Also:
- Constant Field Values
-
SUPER_USER_ID
static final int SUPER_USER_ID
- See Also:
- Constant Field Values
-
UKNOWN_USER_ID
static final int UKNOWN_USER_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getVcsModifications
@NotNull java.util.List<SVcsModification> getVcsModifications(int numberOfActiveDays)
Returns the list of changes made by this user filtered according to the caller's permissions.- Parameters:
numberOfActiveDays
- number of last active days of changing- Returns:
- unmodifiable list of user changes
- Since:
- 5.0
-
getAllModifications
@NotNull java.util.List<SVcsModification> getAllModifications()
Returns the list of all (personal and non-personal) user modifications sorted by VCS date. Returns only modifications which have at least one related configuration.- Returns:
- see above
- Since:
- 6.0
-
updateUserAccount
void updateUserAccount(@NotNull java.lang.String username, java.lang.String name, java.lang.String email) throws UserNotFoundException, DuplicateUserAccountException, EmptyUsernameException
Updates user fields: username, name and email.- Parameters:
username
- username, cannot be nullname
- full name of a useremail
- email address- Throws:
UserNotFoundException
- if specified user no longer exists in the modelDuplicateUserAccountException
- if a new username name already assigned to another userEmptyUsernameException
- if username is an empty string
-
setUserProperties
void setUserProperties(@NotNull java.util.Map<? extends PropertyKey,java.lang.String> properties) throws UserNotFoundException
Updates properties of the user specified by user id. Only those properties will be updated which keys are specified in the properties map. All other properties will be left intact.- Parameters:
properties
- properties- Throws:
UserNotFoundException
- if specified user no longer exists
-
setUserProperty
void setUserProperty(@NotNull PropertyKey propertyKey, java.lang.String value) throws UserNotFoundException
Sets a property with specified key and value in user profile- Parameters:
propertyKey
- property keyvalue
- value of the property- Throws:
UserNotFoundException
- if specified user no longer exists
-
deleteUserProperty
void deleteUserProperty(@NotNull PropertyKey propertyKey) throws UserNotFoundException
Deletes a property with specified key from the user profile.- Parameters:
propertyKey
- property key- Throws:
UserNotFoundException
- if specified user no longer exists
-
setPassword
void setPassword(java.lang.String password) throws UserNotFoundException
Changes password of this user- Parameters:
password
- new password- Throws:
UserNotFoundException
- if specified user no longer exists
-
getProjectsOrder
@NotNull java.util.List<java.lang.String> getProjectsOrder() throws UserNotFoundException
- Returns:
- List of project internal IDs in configured order. Empty list will be returned in case user didn't configure any order.
- Throws:
UserNotFoundException
- if specified user no longer exists- Since:
- 10.0
-
setProjectsOrder
void setProjectsOrder(@NotNull java.util.List<java.lang.String> projectsOrder) throws UserNotFoundException
Sets order of the projects.- Parameters:
projectsOrder
- identificators of all projects in the order specified by user- Throws:
UserNotFoundException
- if specified user no longer exists
-
setVisibleProjects
void setVisibleProjects(@NotNull java.util.Collection<java.lang.String> visibleProjects) throws UserNotFoundException
Sets projects visible for specified user- Parameters:
visibleProjects
- collection of identifiers of visible projects- Throws:
UserNotFoundException
- if specified user no longer exists
-
hideProject
void hideProject(@NotNull java.lang.String projectId) throws UserNotFoundException
Marks a project with specified id as invisible- Parameters:
projectId
- id of the project- Throws:
UserNotFoundException
- if this user does not exist anymore
-
setLastLoginTimestamp
void setLastLoginTimestamp(@NotNull java.util.Date timestamp) throws UserNotFoundException
Updates last login timestamp- Parameters:
timestamp
- last login timestamp- Throws:
UserNotFoundException
- if this user does not exist anymore
-
setBlockState
void setBlockState(java.lang.String blockType, java.lang.String blockState)
Stores collapsable block state for this user- Parameters:
blockType
- type of blockblockState
- state
-
getBlockState
@Nullable java.lang.String getBlockState(java.lang.String blockType)
Retrieves state of a block stored for this user- Parameters:
blockType
- type of block- Returns:
- block state or null
-
getUserGroups
@NotNull java.util.List<UserGroup> getUserGroups()
Returns the list of groups which this user belongs to. Only groups which contain this user directly are considered. If you need all user groups usegetAllUserGroups()
.No specific order of the groups is guaranteed.
- Returns:
- list of groups containing this user
- Since:
- 4.5
- See Also:
getAllUserGroups()
-
getAllUserGroups
@NotNull java.util.List<UserGroup> getAllUserGroups()
Returns the list of all user groups that include this user, directly or through intermediate subgroups.No specific order of the groups is guaranteed.
- Returns:
- list of all groups containing this user
- Since:
- 4.5
- See Also:
getUserGroups()
-
getVcsUsernameProperties
@NotNull java.util.List<VcsUsernamePropertyKey> getVcsUsernameProperties()
Returns list of VCS username properties associated with this user. VCS username property defines username of this user in a concrete VCS root or VCS repository type (Subversion, Perforce, etc).- Returns:
- list of VCS usernames
-
getOrderedBuildTypes
@NotNull java.util.List<SBuildType> getOrderedBuildTypes(@Nullable SProject project)
Returns the list of build configurations (in a project, or globally) sorted according to user settings. The configurations invisible for the user are omitted.- Parameters:
project
- the project (can be null)- Returns:
- the list of build configurations
- Since:
- 5.1
-
getBuildTypesOrder
@NotNull java.util.Collection<SBuildType> getBuildTypesOrder(@NotNull SProject project)
- Parameters:
project
- the project- Returns:
- List of build configurations in configured order. Empty list will be returned in case user didn't configure any order.
- Since:
- 10.0
-
setBuildTypesOrder
void setBuildTypesOrder(@NotNull SProject project, @NotNull java.util.List<SBuildType> visible, @NotNull java.util.List<SBuildType> invisible)
Sets visible and invisible build types for the given project in the specified order.- Parameters:
project
- the projectvisible
- the list of visible build typesinvisible
- the list of invisible build types- Since:
- 5.1
-
isHighlightRelatedDataInUI
boolean isHighlightRelatedDataInUI()
Returns true if highlighting of user changes, investigations, and other related data in web UI is enabled. The value is controlled by theStandardProperties.HIGHLIGHT_MY_CHANGES
property.- Returns:
- true if highlighting of user changes, investigations, and other related data in web UI is enabled.
- Since:
- 7.1
-
isGuest
boolean isGuest()
Returns true if the user is guest- Since:
- 2017.2
-
-