Class InMemoryUser
- java.lang.Object
-
- jetbrains.buildServer.controllers.login.InMemoryUser
-
- All Implemented Interfaces:
Loggable,NotificationRulesHolder,AuthorityHolder,RolesHolder,UserEx,UserRolesInit,PropertyHolder,SPropertyHolder,SUser,User
public class InMemoryUser extends Object implements UserEx
Original GuestUser or RootUser throws exception on attempt to change its profile (because there is no such thing as profile for guest user). However in the web interface you often need to show information based on current user settings. That is why this object is used in web interfaces instead of original guest user. The settings of this object are not persisted, they disappear once the user logs out. Also this wrapper is used in read only mode.
-
-
Field Summary
-
Fields inherited from interface jetbrains.buildServer.users.SUser
GUEST_USER_ID, SUPER_USER_ID, UKNOWN_USER_ID
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longaddNewRule(String notifierType, NotificationRule rule)Adds new rule to the rules of specified user for specified notifier type.voidaddRole(RoleScope scope, Role role)Adds role with specified scopevoidaddVcsUsername(VcsUsernamePropertyKey key, String userName)voidapplyOrder(String notifierType, long[] ruleIds)Sorts the notification rules in the specified order.voiddeleteAttribute(String attributeKey)Delete user attributebooleandeleteProperty(PropertyKey propertyKey)Deletes a property with specified key.voiddeleteUserProperty(PropertyKey propertyKey)Deletes a property with specified key from the user profile.Stringdescribe(boolean verbose)booleanequals(Object obj)Collection<Long>findConflictingRules(String notifierType, WatchedBuilds watch)Searches for rules which intersect with specified watched builds.NotificationRulefindRuleById(long ruleId)Searches for a rule with specified id.List<SVcsModification>getAllModifications()Returns the list of all (personal and non-personal) user modifications sorted by VCS date.Collection<RolesHolder>getAllParentHolders()Returns all parent holders including transitive onesList<NotificationRulesHolder>getAllParentRulesHolders()Returns all (direct and inherited) parent notification rules holdersList<String>getAllProjects()Returns all projects sorted according to the order specified by user.List<UserGroup>getAllUserGroups()Returns the list of all user groups that include this user, directly or through intermediate subgroups.UsergetAssociatedUser()Returns the user object associated with the principal.StringgetAttribute(String attributeKey)Get user attributeMap<String,String>getAttributes()Get all user attributesStringgetBlockState(String blockType)Retrieves state of a block stored for this userbooleangetBooleanProperty(PropertyKey propertyKey)Returns value of the boolean propertyCollection<SBuildType>getBuildTypesOrder(SProject project)StringgetDescriptiveName()Returns full name of the user if it is not empty, otherwise returns username.StringgetEmail()Returns e-mail of this userStringgetExtendedName()SortedMap<SProject,List<SBuildType>>getFilteredVisibleBuildTypes(BuildTypeFilter filter)Returns sorted map of build configurations per project.PermissionsgetGlobalPermissions()Returns all granted non-project related permissions and all project-related permissions granted globallylonggetId()Returns user idDategetLastLoginTimestamp()Returns this user last login timestampStringgetName()Returns full name of this userList<NotificationRule>getNotificationRules(String notificatorType)Returns the notification rules for specified notifier for this holder (user or group).List<SBuildType>getOrderedBuildTypes(SProject project)Returns the list of build configurations (in a project, or globally) sorted according to user settings.AuthorityHoldergetOriginalAuthorityHolder()The same asSecurityContextEx.getOriginalAuthority()Collection<RolesHolder>getParentHolders()Returns direct (non transitive) parent holders.List<NotificationRulesHolder>getParentRulesHolders()Returns direct parent notification rules holdersPermissionsgetPermissionsGrantedForAllProjects(Collection<String> projectIds)Returns all permissions granted for all projects from the collection.PermissionsgetPermissionsGrantedForAnyOfProjects(Collection<String> projectIds)Returns union of permissions granted for projects from the collection.PermissionsgetPermissionsGrantedForProject(String projectId)Returns all permissions granted for particular project.List<String>getProjectsOrder()Map<String,Permissions>getProjectsPermissions()Returns map of project-related permissions that were granted for a particular project.ProjectVisibilityHoldergetProjectVisibilityHolder()Map<PropertyKey,String>getProperties()Returns map of the propertiesStringgetPropertyValue(PropertyKey propertyKey)Returns value of the property with specified keyStringgetRealm()Returns realm of the user.Collection<RoleEntry>getRoles()Returns roles with their scopesCollection<Role>getRolesWithScope(RoleScope scope)Returns all roles with specified scope.Collection<RoleScope>getScopes()Returns all scopes with assigned rolesList<UserGroup>getUserGroups()Returns the list of groups which this user belongs to.StringgetUsername()Returns username of this userList<SVcsModification>getVcsModifications(int numberOfActiveDays)Returns the list of changes made by this user filtered according to the caller's permissions.List<VcsUsernamePropertyKey>getVcsUsernameProperties()Returns list of VCS username properties associated with this user.Map<VcsUsernamePropertyKey,List<String>>getVcsUsernames()StringgetVerifiedEmail()Returns null if user doesn't have email specified or his email is not verified.List<String>getVisibleProjects()Computes list of visible projects sorted according to the order specified by user.booleanhasAllPermissionsOf(AuthorityHolder authorityHolder)Returns true if this authority holder has all permissions of another authority holder.inthashCode()booleanhasPassword()Returns true if user has password, false otherwise (e.g.voidhideProject(String projectId)Marks a project with specified id as invisiblevoidhideProjects(Collection<String> projectIds)Marks the specified projects as invisiblevoidinit(String username, String name, String email, Long lastLogin, boolean hasPassword)booleanisConfiguredVisibleProjects()Returns whether the user has configured visible projects.booleanisGuest()Returns true if the user is guestbooleanisHasHiddenProjects()Returns whether the user has any hidden (i.e.booleanisHighlightRelatedDataInUI()Returns true if highlighting of user changes, investigations, and other related data in web UI is enabled.booleanisPermissionGrantedForAllProjects(Collection<String> projectIds, Permission permission)Returns true if permission is granted for all projects from the given list.booleanisPermissionGrantedForAnyOfProjects(Collection<String> projectIds, Permission permission)Returns true if specified permission is granted for at least one project from the given collectionbooleanisPermissionGrantedForAnyProject(Permission permission)Returns true if specified permission is granted for at least one projectbooleanisPermissionGrantedForProject(String projectId, Permission permission)Returns true if permission is granted for a project, i.e.booleanisPermissionGrantedGlobally(Permission permission)Returns true if specified permission granted globally (i.e.booleanisPseudoUser()booleanisSystemAdministratorRoleGranted()Returns true if this roles holder contains system administrator role granted directly or inherited via parent holders.booleanisSystemAdministratorRoleGrantedDirectly()Returns true if this roles holder contains system administrator role granted directly.booleanisSystemAdministratorRoleInherited()Returns true if one of the parents (transitively) of this roles holder contains system administrator role.voidremoveRole(Role role)Removes specified role.voidremoveRole(RoleScope scope, Role role)Removes role with specified scopevoidremoveRoles(RoleScope scope)Removes all of the roles having the specified scope.voidremoveRule(long ruleId)Removes the rule with specified id.voidremoveRule(NotificationRule rule)Removes the rule.voidresetBlocks()Reset cached blocksvoidresetBuildTypesOrder(SProject project)Resets the build types order settings to defaults.voidresetCachedAttributes()Reset cached user attributesvoidresetCachedProperties()Reset cached blocksvoidresetCachedVcsUsernames()Reset cached blocksvoidresetRoles()Causes roles reloading from the database.<T> TrunWithRestrictor(AuthorityHolderRestrictor restrictor, SecurityContextEx.RunAsActionWithResult<T> action)voidsetAttribute(String attributeKey, String attributeValue)Set user attributevoidsetBlockState(String blockType, String blockState)Stores collapsable block state for this uservoidsetBuildTypesOrder(SProject project, List<SBuildType> visible, List<SBuildType> invisible)Sets visible and invisible build types for the given project in the specified order.voidsetCreationInProgress(boolean inProgress)voidsetDefaultVcsUsernames(List<String> userNames)booleansetEmailIsVerified(String email)Mark user`s email as verified if it's equal to email passed in parameter.voidsetLastLoginTimestamp(Date timestamp)Updates last login timestampvoidsetNotificationRules(String notifierType, List<NotificationRule> rules)Sets the notification rules for specified notifier.voidsetPassword(String password)Changes password of this uservoidsetProjectsOrder(List<String> projectsOrder)Sets order of the projects.booleansetProperties(Map<? extends PropertyKey,String> properties)Updates the specified properties.booleansetProperty(PropertyKey propertyKey, String value)Sets a property with specified key and value.voidsetUserProperties(Map<? extends PropertyKey,String> properties)Updates properties of the user specified by user id.voidsetUserProperty(PropertyKey propertyKey, String value)Sets a property with specified key and value in user profilevoidsetVcsRootUsernames(VcsRoot root, List<String> userNames)voidsetVcsUsernames(String vcsName, List<String> userNames)voidsetVcsUsernames(VcsUsernamePropertyKey key, List<String> userNames)voidsetVisibleProjects(Collection<String> visibleProjects)Sets projects visible for specified userStringtoString()voidupdatePermissions()Forces this user to recompute its permissions.voidupdateUserAccount(String username, String name, String email)Updates user fields: username, name and email.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.auth.AuthorityHolder
getAllPermissions
-
Methods inherited from interface jetbrains.buildServer.users.impl.UserEx
runWithRestrictor
-
-
-
-
Method Detail
-
setProperties
public boolean setProperties(@NotNull Map<? extends PropertyKey,String> properties)Description copied from interface:SPropertyHolderUpdates the specified properties. Only those properties will be updated which keys are specified in the properties map. All other properties will be left intact.- Specified by:
setPropertiesin interfaceSPropertyHolder- Parameters:
properties- properties- Returns:
- true if at least one property was changed, false otherwise
-
setProperty
public boolean setProperty(@NotNull PropertyKey propertyKey, String value)Description copied from interface:SPropertyHolderSets a property with specified key and value.- Specified by:
setPropertyin interfaceSPropertyHolder- Parameters:
propertyKey- property keyvalue- value of the property- Returns:
- true if the property value was actually changed, false otherwise
-
deleteProperty
public boolean deleteProperty(@NotNull PropertyKey propertyKey)Description copied from interface:SPropertyHolderDeletes a property with specified key.- Specified by:
deletePropertyin interfaceSPropertyHolder- Parameters:
propertyKey- property key- Returns:
- true if the property was actually deleted, false otherwise
-
setUserProperties
public void setUserProperties(@NotNull Map<? extends PropertyKey,String> properties) throws UserNotFoundExceptionDescription copied from interface:SUserUpdates 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.- Specified by:
setUserPropertiesin interfaceSUser- Parameters:
properties- properties- Throws:
UserNotFoundException- if specified user no longer exists
-
setUserProperty
public void setUserProperty(@NotNull PropertyKey propertyKey, String value) throws UserNotFoundExceptionDescription copied from interface:SUserSets a property with specified key and value in user profile- Specified by:
setUserPropertyin interfaceSUser- Parameters:
propertyKey- property keyvalue- value of the property- Throws:
UserNotFoundException- if specified user no longer exists
-
deleteUserProperty
public void deleteUserProperty(@NotNull PropertyKey propertyKey) throws UserNotFoundExceptionDescription copied from interface:SUserDeletes a property with specified key from the user profile.- Specified by:
deleteUserPropertyin interfaceSUser- Parameters:
propertyKey- property key- Throws:
UserNotFoundException- if specified user no longer exists
-
getPropertyValue
public String getPropertyValue(PropertyKey propertyKey)
Description copied from interface:PropertyHolderReturns value of the property with specified key- Specified by:
getPropertyValuein interfacePropertyHolder- Parameters:
propertyKey- value of the property with specified key- Returns:
- value of the property with specified key
-
getBooleanProperty
public boolean getBooleanProperty(PropertyKey propertyKey)
Description copied from interface:PropertyHolderReturns value of the boolean property- Specified by:
getBooleanPropertyin interfacePropertyHolder- Parameters:
propertyKey- property key- Returns:
- value
-
getProperties
@NotNull public Map<PropertyKey,String> getProperties()
Description copied from interface:PropertyHolderReturns map of the properties- Specified by:
getPropertiesin interfacePropertyHolder- Returns:
- map of the properties
-
setBlockState
public void setBlockState(String blockType, String blockState)
Description copied from interface:SUserStores collapsable block state for this user- Specified by:
setBlockStatein interfaceSUser- Parameters:
blockType- type of blockblockState- state
-
getBlockState
public String getBlockState(String blockType)
Description copied from interface:SUserRetrieves state of a block stored for this user- Specified by:
getBlockStatein interfaceSUser- Parameters:
blockType- type of block- Returns:
- block state or null
-
isPermissionGrantedGlobally
public boolean isPermissionGrantedGlobally(@NotNull Permission permission)Description copied from interface:AuthorityHolderReturns true if specified permission granted globally (i.e. not associated with any particular object)- Specified by:
isPermissionGrantedGloballyin interfaceAuthorityHolder- Parameters:
permission- permission to check- Returns:
- true or false
-
getVisibleProjects
public List<String> getVisibleProjects()
Description copied from interface:UserComputes list of visible projects sorted according to the order specified by user.- Specified by:
getVisibleProjectsin interfaceUser- Returns:
- list of visible projects ids
-
getAllProjects
public List<String> getAllProjects()
Description copied from interface:UserReturns all projects sorted according to the order specified by user.- Specified by:
getAllProjectsin interfaceUser- Returns:
- list of all of the projects ids
-
isPermissionGrantedForProject
public boolean isPermissionGrantedForProject(@NotNull String projectId, @NotNull Permission permission)Description copied from interface:AuthorityHolderReturns true if permission is granted for a project, i.e. the result is true if there is a project related permission granted globally or for specified project- Specified by:
isPermissionGrantedForProjectin interfaceAuthorityHolder- Parameters:
projectId- project internal idpermission- permission to check- Returns:
- see above
-
isPermissionGrantedForAllProjects
public boolean isPermissionGrantedForAllProjects(@NotNull Collection<String> projectIds, @NotNull Permission permission)Description copied from interface:AuthorityHolderReturns true if permission is granted for all projects from the given list. Returns false if projectIds is empty.- Specified by:
isPermissionGrantedForAllProjectsin interfaceAuthorityHolder- Parameters:
projectIds- collection of project idspermission- permission to check @return see above- See Also:
AuthorityHolder.isPermissionGrantedForProject(java.lang.String, jetbrains.buildServer.serverSide.auth.Permission)
-
getVcsModifications
@NotNull public List<SVcsModification> getVcsModifications(int numberOfActiveDays)
Description copied from interface:SUserReturns the list of changes made by this user filtered according to the caller's permissions.- Specified by:
getVcsModificationsin interfaceSUser- Parameters:
numberOfActiveDays- number of last active days of changing- Returns:
- unmodifiable list of user changes
-
isPermissionGrantedForAnyProject
public boolean isPermissionGrantedForAnyProject(@NotNull Permission permission)Description copied from interface:AuthorityHolderReturns true if specified permission is granted for at least one project- Specified by:
isPermissionGrantedForAnyProjectin interfaceAuthorityHolder- Parameters:
permission- permission to check- Returns:
- see above
-
isPermissionGrantedForAnyOfProjects
public boolean isPermissionGrantedForAnyOfProjects(@NotNull Collection<String> projectIds, @NotNull Permission permission)Description copied from interface:AuthorityHolderReturns true if specified permission is granted for at least one project from the given collection- Specified by:
isPermissionGrantedForAnyOfProjectsin interfaceAuthorityHolderpermission- permission to check- Returns:
- see above
-
getAllModifications
@NotNull public List<SVcsModification> getAllModifications()
Description copied from interface:SUserReturns the list of all (personal and non-personal) user modifications sorted by VCS date. Returns only modifications which have at least one related configuration.- Specified by:
getAllModificationsin interfaceSUser- Returns:
- see above
-
updateUserAccount
public void updateUserAccount(@NotNull String username, String name, String email) throws UserNotFoundException, DuplicateUserAccountExceptionDescription copied from interface:SUserUpdates user fields: username, name and email.- Specified by:
updateUserAccountin interfaceSUser- 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 user
-
getGlobalPermissions
@NotNull public Permissions getGlobalPermissions()
Description copied from interface:AuthorityHolderReturns all granted non-project related permissions and all project-related permissions granted globally- Specified by:
getGlobalPermissionsin interfaceAuthorityHolder- Returns:
- see above
-
getProjectsPermissions
@NotNull public Map<String,Permissions> getProjectsPermissions()
Description copied from interface:AuthorityHolderReturns map of project-related permissions that were granted for a particular project. Project internal id is used as the key.- Specified by:
getProjectsPermissionsin interfaceAuthorityHolder- Returns:
- map of project permissions
-
getPermissionsGrantedForProject
@NotNull public Permissions getPermissionsGrantedForProject(@NotNull String projectId)
Description copied from interface:AuthorityHolderReturns all permissions granted for particular project. These include permissions granted specifically for the specified project and granted global project-related permissions (i.e. permissions supporting project associationPermission.isProjectAssociationSupported()).- Specified by:
getPermissionsGrantedForProjectin interfaceAuthorityHolder- Parameters:
projectId- project internal id- Returns:
- all granted permissions for particular project
-
getPermissionsGrantedForAllProjects
@NotNull public Permissions getPermissionsGrantedForAllProjects(@NotNull Collection<String> projectIds)
Description copied from interface:AuthorityHolderReturns all permissions granted for all projects from the collection. These include permissions granted specifically for the specified projects and granted global project-related permissions (i.e. permissions supporting project associationPermission.isProjectAssociationSupported()).- Specified by:
getPermissionsGrantedForAllProjectsin interfaceAuthorityHolder- Parameters:
projectIds- collection of project internal ids- Returns:
- all granted permissions for all projects
-
getPermissionsGrantedForAnyOfProjects
@NotNull public Permissions getPermissionsGrantedForAnyOfProjects(@NotNull Collection<String> projectIds)
Description copied from interface:AuthorityHolderReturns union of permissions granted for projects from the collection. These include permissions granted specifically for the specified projects and granted global project-related permissions (i.e. permissions supporting project associationPermission.isProjectAssociationSupported()).- Specified by:
getPermissionsGrantedForAnyOfProjectsin interfaceAuthorityHolder- Parameters:
projectIds- collection of project internal ids- Returns:
- all granted permissions for all projects
-
getAssociatedUser
@Nullable public User getAssociatedUser()
Description copied from interface:AuthorityHolderReturns the user object associated with the principal.- Specified by:
getAssociatedUserin interfaceAuthorityHolder- Returns:
- may be null if the authority holder is not a user.
-
hasAllPermissionsOf
public boolean hasAllPermissionsOf(@NotNull AuthorityHolder authorityHolder)Description copied from interface:AuthorityHolderReturns true if this authority holder has all permissions of another authority holder.- Specified by:
hasAllPermissionsOfin interfaceAuthorityHolder- Returns:
- see above
-
getRolesWithScope
@NotNull public Collection<Role> getRolesWithScope(@NotNull RoleScope scope)
Description copied from interface:RolesHolderReturns all roles with specified scope.- Specified by:
getRolesWithScopein interfaceRolesHolder- Parameters:
scope- roles scope- Returns:
- all roles with specified scope.
-
setPassword
public void setPassword(String password) throws UserNotFoundException
Description copied from interface:SUserChanges password of this user- Specified by:
setPasswordin interfaceSUser- Parameters:
password- new password- Throws:
UserNotFoundException- if specified user no longer exists
-
hasPassword
public boolean hasPassword()
Description copied from interface:UserExReturns true if user has password, false otherwise (e.g. if it was created by NT domain or LDAP login module)- Specified by:
hasPasswordin interfaceUserEx- Returns:
-
isPseudoUser
public boolean isPseudoUser()
- Specified by:
isPseudoUserin interfaceUserEx
-
setEmailIsVerified
public boolean setEmailIsVerified(@NotNull String email)Description copied from interface:UserExMark user`s email as verified if it's equal to email passed in parameter.- Specified by:
setEmailIsVerifiedin interfaceUserEx- Returns:
- true if verified email was set, false otherwise
-
getVerifiedEmail
@Nullable public String getVerifiedEmail()
Description copied from interface:UserExReturns null if user doesn't have email specified or his email is not verified.- Specified by:
getVerifiedEmailin interfaceUserEx
-
getScopes
public Collection<RoleScope> getScopes()
Description copied from interface:RolesHolderReturns all scopes with assigned roles- Specified by:
getScopesin interfaceRolesHolder- Returns:
- all scopes with assigned roles
-
getProjectsOrder
@NotNull public List<String> getProjectsOrder() throws UserNotFoundException
- Specified by:
getProjectsOrderin interfaceSUser- 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
-
setProjectsOrder
public void setProjectsOrder(@NotNull List<String> projectsOrder) throws UserNotFoundExceptionDescription copied from interface:SUserSets order of the projects.- Specified by:
setProjectsOrderin interfaceSUser- Parameters:
projectsOrder- identificators of all projects in the order specified by user- Throws:
UserNotFoundException- if specified user no longer exists
-
getRoles
@NotNull public Collection<RoleEntry> getRoles()
Description copied from interface:RolesHolderReturns roles with their scopes- Specified by:
getRolesin interfaceRolesHolder- Returns:
- roles with their scopes
-
setVisibleProjects
public void setVisibleProjects(@NotNull Collection<String> visibleProjects) throws UserNotFoundExceptionDescription copied from interface:SUserSets projects visible for specified user- Specified by:
setVisibleProjectsin interfaceSUser- Parameters:
visibleProjects- collection of identifiers of visible projects- Throws:
UserNotFoundException- if specified user no longer exists
-
resetRoles
public void resetRoles()
Description copied from interface:UserRolesInitCauses roles reloading from the database.- Specified by:
resetRolesin interfaceUserRolesInit
-
hideProject
public void hideProject(@NotNull String projectId) throws UserNotFoundExceptionDescription copied from interface:SUserMarks a project with specified id as invisible- Specified by:
hideProjectin interfaceSUser- Parameters:
projectId- id of the project- Throws:
UserNotFoundException- if this user does not exist anymore
-
hideProjects
public void hideProjects(@NotNull Collection<String> projectIds) throws UserNotFoundExceptionDescription copied from interface:SUserMarks the specified projects as invisible- Specified by:
hideProjectsin interfaceSUser- Parameters:
projectIds- ids of the project to hide- Throws:
UserNotFoundException- if this user does not exist anymore
-
addRole
public void addRole(@NotNull RoleScope scope, @NotNull Role role) throws UserNotFoundExceptionDescription copied from interface:RolesHolderAdds role with specified scope- Specified by:
addRolein interfaceRolesHolder- Parameters:
scope- scope of the rolerole- role- Throws:
UserNotFoundException
-
setLastLoginTimestamp
public void setLastLoginTimestamp(@NotNull Date timestamp) throws UserNotFoundExceptionDescription copied from interface:SUserUpdates last login timestamp- Specified by:
setLastLoginTimestampin interfaceSUser- Parameters:
timestamp- last login timestamp- Throws:
UserNotFoundException- if this user does not exist anymore
-
removeRole
public void removeRole(@NotNull RoleScope scope, @NotNull Role role) throws UserNotFoundExceptionDescription copied from interface:RolesHolderRemoves role with specified scope- Specified by:
removeRolein interfaceRolesHolder- Parameters:
scope- scope of the rolerole- role- Throws:
UserNotFoundException
-
removeRoles
public void removeRoles(@NotNull RoleScope scope) throws UserNotFoundExceptionDescription copied from interface:RolesHolderRemoves all of the roles having the specified scope.- Specified by:
removeRolesin interfaceRolesHolder- Parameters:
scope- scope of the role- Throws:
UserNotFoundException
-
setNotificationRules
public void setNotificationRules(@NotNull String notifierType, @NotNull List<NotificationRule> rules)Description copied from interface:NotificationRulesHolderSets the notification rules for specified notifier.- Specified by:
setNotificationRulesin interfaceNotificationRulesHolder- Parameters:
notifierType- type of the notifierrules- rules to save
-
removeRole
public void removeRole(@NotNull Role role)Description copied from interface:RolesHolderRemoves specified role. If the role is associated with several scopes all of these roles will be removed.- Specified by:
removeRolein interfaceRolesHolder- Parameters:
role- role to remove
-
addNewRule
public long addNewRule(@NotNull String notifierType, @NotNull NotificationRule rule) throws DuplicateNotificationRuleExceptionDescription copied from interface:NotificationRulesHolderAdds new rule to the rules of specified user for specified notifier type.- Specified by:
addNewRulein interfaceNotificationRulesHolder- Parameters:
notifierType- type of the notifierrule- rule to add- Returns:
- the id of the newly created rule
- Throws:
DuplicateNotificationRuleException- if similar rule already exists
-
isSystemAdministratorRoleGranted
public boolean isSystemAdministratorRoleGranted()
Description copied from interface:RolesHolderReturns true if this roles holder contains system administrator role granted directly or inherited via parent holders. Same as:isSystemAdministratorRoleGrantedDirectly() || isSystemAdministratorRoleInherited()
- Specified by:
isSystemAdministratorRoleGrantedin interfaceRolesHolder- Returns:
- see above.
-
removeRule
public void removeRule(long ruleId)
Description copied from interface:NotificationRulesHolderRemoves the rule with specified id.- Specified by:
removeRulein interfaceNotificationRulesHolder- Parameters:
ruleId- id of the rule
-
removeRule
public void removeRule(@NotNull NotificationRule rule)Description copied from interface:NotificationRulesHolderRemoves the rule. ThrowsNotificationRuleChangedExceptionif notification rule with same id was already changed. Does nothing if notification rule doesn't exist.- Specified by:
removeRulein interfaceNotificationRulesHolder- Parameters:
rule- rule to remove
-
isSystemAdministratorRoleGrantedDirectly
public boolean isSystemAdministratorRoleGrantedDirectly()
Description copied from interface:RolesHolderReturns true if this roles holder contains system administrator role granted directly.- Specified by:
isSystemAdministratorRoleGrantedDirectlyin interfaceRolesHolder- Returns:
- see above.
-
applyOrder
public void applyOrder(@NotNull String notifierType, @NotNull long[] ruleIds)Description copied from interface:NotificationRulesHolderSorts the notification rules in the specified order.- Specified by:
applyOrderin interfaceNotificationRulesHolder- Parameters:
notifierType- type of the notifierruleIds- ids of the rules in the required order
-
isSystemAdministratorRoleInherited
public boolean isSystemAdministratorRoleInherited()
Description copied from interface:RolesHolderReturns true if one of the parents (transitively) of this roles holder contains system administrator role.- Specified by:
isSystemAdministratorRoleInheritedin interfaceRolesHolder- Returns:
- see above
-
getParentHolders
@NotNull public Collection<RolesHolder> getParentHolders()
Description copied from interface:RolesHolderReturns direct (non transitive) parent holders.- Specified by:
getParentHoldersin interfaceRolesHolder- Returns:
- parent holders
-
getOrderedBuildTypes
@NotNull public List<SBuildType> getOrderedBuildTypes(@Nullable SProject project)
Description copied from interface:SUserReturns the list of build configurations (in a project, or globally) sorted according to user settings. The configurations invisible for the user are omitted.- Specified by:
getOrderedBuildTypesin interfaceSUser- Parameters:
project- the project (can be null)- Returns:
- the list of build configurations
-
getAllParentHolders
@NotNull public Collection<RolesHolder> getAllParentHolders()
Description copied from interface:RolesHolderReturns all parent holders including transitive ones- Specified by:
getAllParentHoldersin interfaceRolesHolder- Returns:
- all parent holders
-
setBuildTypesOrder
public void setBuildTypesOrder(@NotNull SProject project, @NotNull List<SBuildType> visible, @NotNull List<SBuildType> invisible)Description copied from interface:SUserSets visible and invisible build types for the given project in the specified order.- Specified by:
setBuildTypesOrderin interfaceSUser- Parameters:
project- the projectvisible- the list of visible build typesinvisible- the list of invisible build types
-
getFilteredVisibleBuildTypes
@NotNull public SortedMap<SProject,List<SBuildType>> getFilteredVisibleBuildTypes(@Nullable BuildTypeFilter filter)
Description copied from interface:UserExReturns sorted map of build configurations per project. The build configurations are sorted according to user settings.- Specified by:
getFilteredVisibleBuildTypesin interfaceUserEx- Parameters:
filter- filter of build configurations, can be null- Returns:
- sorted map of build types per project
-
resetBuildTypesOrder
public void resetBuildTypesOrder(@NotNull SProject project)Description copied from interface:UserExResets the build types order settings to defaults.- Specified by:
resetBuildTypesOrderin interfaceUserEx- Parameters:
project- the project
-
updatePermissions
public void updatePermissions()
Description copied from interface:UserExForces this user to recompute its permissions.- Specified by:
updatePermissionsin interfaceUserEx
-
getOriginalAuthorityHolder
@NotNull public AuthorityHolder getOriginalAuthorityHolder()
Description copied from interface:UserExThe same asSecurityContextEx.getOriginalAuthority()- Specified by:
getOriginalAuthorityHolderin interfaceUserEx
-
isHasHiddenProjects
public boolean isHasHiddenProjects()
Description copied from interface:UserExReturns whether the user has any hidden (i.e. configured to be not-visible) projects.- Specified by:
isHasHiddenProjectsin interfaceUserEx- Returns:
- true if the user has any hidden projects
-
isConfiguredVisibleProjects
public boolean isConfiguredVisibleProjects()
Description copied from interface:UserExReturns whether the user has configured visible projects.- Specified by:
isConfiguredVisibleProjectsin interfaceUserEx- Returns:
- true if the user has configured visible projects
-
getUserGroups
@NotNull public List<UserGroup> getUserGroups()
Description copied from interface:SUserReturns the list of groups which this user belongs to. Only groups which contain this user directly are considered. If you need all user groups useSUser.getAllUserGroups().No specific order of the groups is guaranteed.
- Specified by:
getUserGroupsin interfaceSUser- Returns:
- list of groups containing this user
- See Also:
SUser.getAllUserGroups()
-
getAllUserGroups
@NotNull public List<UserGroup> getAllUserGroups()
Description copied from interface:SUserReturns the list of all user groups that include this user, directly or through intermediate subgroups.No specific order of the groups is guaranteed.
- Specified by:
getAllUserGroupsin interfaceSUser- Returns:
- list of all groups containing this user
- See Also:
SUser.getUserGroups()
-
getVcsUsernameProperties
@NotNull public List<VcsUsernamePropertyKey> getVcsUsernameProperties()
Description copied from interface:SUserReturns 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).- Specified by:
getVcsUsernamePropertiesin interfaceSUser- Returns:
- list of VCS usernames
-
getVcsUsernames
@NotNull public Map<VcsUsernamePropertyKey,List<String>> getVcsUsernames()
- Specified by:
getVcsUsernamesin interfaceUserEx
-
getNotificationRules
@NotNull public List<NotificationRule> getNotificationRules(@NotNull String notificatorType)
Description copied from interface:NotificationRulesHolderReturns the notification rules for specified notifier for this holder (user or group).- Specified by:
getNotificationRulesin interfaceNotificationRulesHolder- Parameters:
notificatorType- type of the notifier- Returns:
- list of notification rules for specified notifier
-
findConflictingRules
public Collection<Long> findConflictingRules(@NotNull String notifierType, @NotNull WatchedBuilds watch)
Description copied from interface:NotificationRulesHolderSearches for rules which intersect with specified watched builds.- Specified by:
findConflictingRulesin interfaceNotificationRulesHolder- Parameters:
notifierType- type of the notifierwatch- watched builds- Returns:
- list of conflicting rules ids
-
findRuleById
public NotificationRule findRuleById(long ruleId)
Description copied from interface:NotificationRulesHolderSearches for a rule with specified id.- Specified by:
findRuleByIdin interfaceNotificationRulesHolder- Parameters:
ruleId- id of the rule- Returns:
- a found rule, or null
-
getParentRulesHolders
@NotNull public List<NotificationRulesHolder> getParentRulesHolders()
Description copied from interface:NotificationRulesHolderReturns direct parent notification rules holders- Specified by:
getParentRulesHoldersin interfaceNotificationRulesHolder- Returns:
- direct parent notification rules holders
-
getAllParentRulesHolders
@NotNull public List<NotificationRulesHolder> getAllParentRulesHolders()
Description copied from interface:NotificationRulesHolderReturns all (direct and inherited) parent notification rules holders- Specified by:
getAllParentRulesHoldersin interfaceNotificationRulesHolder- Returns:
- all (direct and inherited) parent notification rules holders
-
getId
public long getId()
Description copied from interface:UserReturns user id
-
getRealm
public String getRealm()
Description copied from interface:UserReturns realm of the user.
-
getUsername
public String getUsername()
Description copied from interface:UserReturns username of this user- Specified by:
getUsernamein interfaceUser- Returns:
- username
-
getName
public String getName()
Description copied from interface:UserReturns full name of this user
-
getEmail
public String getEmail()
Description copied from interface:UserReturns e-mail of this user
-
getDescriptiveName
public String getDescriptiveName()
Description copied from interface:UserReturns full name of the user if it is not empty, otherwise returns username.- Specified by:
getDescriptiveNamein interfaceUser- Returns:
- full name or username if full name is empty
-
getExtendedName
public String getExtendedName()
- Specified by:
getExtendedNamein interfaceUser- Returns:
- user full name and username in the form: <full name> (<username>)
-
getLastLoginTimestamp
public Date getLastLoginTimestamp()
Description copied from interface:UserReturns this user last login timestamp- Specified by:
getLastLoginTimestampin interfaceUser- Returns:
- last login timestamp
-
isHighlightRelatedDataInUI
public boolean isHighlightRelatedDataInUI()
Description copied from interface:SUserReturns true if highlighting of user changes, investigations, and other related data in web UI is enabled. The value is controlled by theStandardProperties.HIGHLIGHT_MY_CHANGESproperty.- Specified by:
isHighlightRelatedDataInUIin interfaceSUser- Returns:
- true if highlighting of user changes, investigations, and other related data in web UI is enabled.
-
isGuest
public boolean isGuest()
Description copied from interface:SUserReturns true if the user is guest
-
getBuildTypesOrder
@NotNull public Collection<SBuildType> getBuildTypesOrder(@NotNull SProject project)
- Specified by:
getBuildTypesOrderin interfaceSUser- 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.
-
describe
@NotNull public String describe(boolean verbose)
-
setDefaultVcsUsernames
public void setDefaultVcsUsernames(@NotNull List<String> userNames)- Specified by:
setDefaultVcsUsernamesin interfaceUserEx
-
setVcsUsernames
public void setVcsUsernames(@NotNull String vcsName, @NotNull List<String> userNames)- Specified by:
setVcsUsernamesin interfaceUserEx
-
setVcsRootUsernames
public void setVcsRootUsernames(@NotNull VcsRoot root, @NotNull List<String> userNames)- Specified by:
setVcsRootUsernamesin interfaceUserEx
-
setVcsUsernames
public void setVcsUsernames(@NotNull VcsUsernamePropertyKey key, @NotNull List<String> userNames)- Specified by:
setVcsUsernamesin interfaceUserEx
-
addVcsUsername
public void addVcsUsername(@NotNull VcsUsernamePropertyKey key, @NotNull String userName)- Specified by:
addVcsUsernamein interfaceUserEx
-
getProjectVisibilityHolder
public ProjectVisibilityHolder getProjectVisibilityHolder()
- Specified by:
getProjectVisibilityHolderin interfaceUserEx
-
setCreationInProgress
public void setCreationInProgress(boolean inProgress)
- Specified by:
setCreationInProgressin interfaceUserEx
-
init
public void init(@NotNull String username, String name, String email, Long lastLogin, boolean hasPassword)
-
resetBlocks
public void resetBlocks()
Description copied from interface:UserExReset cached blocks- Specified by:
resetBlocksin interfaceUserEx
-
resetCachedProperties
public void resetCachedProperties()
Description copied from interface:UserExReset cached blocks- Specified by:
resetCachedPropertiesin interfaceUserEx
-
resetCachedVcsUsernames
public void resetCachedVcsUsernames()
Description copied from interface:UserExReset cached blocks- Specified by:
resetCachedVcsUsernamesin interfaceUserEx
-
setAttribute
public void setAttribute(@NotNull String attributeKey, @NotNull String attributeValue)Description copied from interface:UserExSet user attribute- Specified by:
setAttributein interfaceUserEx
-
getAttribute
@Nullable public String getAttribute(@NotNull String attributeKey)
Description copied from interface:UserExGet user attribute- Specified by:
getAttributein interfaceUserEx- Returns:
- user attribute or null if there is no attribute with such key
-
getAttributes
@NotNull public Map<String,String> getAttributes()
Description copied from interface:UserExGet all user attributes- Specified by:
getAttributesin interfaceUserEx- Returns:
- user attributes or an empty map
-
deleteAttribute
public void deleteAttribute(@NotNull String attributeKey)Description copied from interface:UserExDelete user attribute- Specified by:
deleteAttributein interfaceUserEx
-
resetCachedAttributes
public void resetCachedAttributes()
Description copied from interface:UserExReset cached user attributes- Specified by:
resetCachedAttributesin interfaceUserEx
-
runWithRestrictor
public <T> T runWithRestrictor(@NotNull AuthorityHolderRestrictor restrictor, @NotNull SecurityContextEx.RunAsActionWithResult<T> action)- Specified by:
runWithRestrictorin interfaceUserEx
-
-