Package jetbrains.buildServer.users.impl
Class AssociatedUser
- java.lang.Object
-
- jetbrains.buildServer.users.impl.BaseUser
-
- jetbrains.buildServer.users.impl.UserImpl
-
- jetbrains.buildServer.users.impl.AssociatedUser
-
- All Implemented Interfaces:
Loggable,NotificationRulesHolder,AuthorityHolder,RolesHolder,UserEx,UserRolesInit,PropertyHolder,SPropertyHolder,SUser,User
public class AssociatedUser extends UserImpl
User associated with build type or project This user is not an actual TeamCity user but rather "fake" user that acts on behalf of the build type of project it's associated with
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jetbrains.buildServer.users.impl.UserImpl
UserImpl.BuildTypesOrder
-
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.users.impl.UserImpl
myProjectManager, PROTECTED_USER_PROPERTY_PREFIX, PUBLIC_USER_PROPERTY_PREFIX, SECURED_USER_PROPERTY_PREFIX, VERIFIED_EMAIL_PROPERTY_NAME
-
Fields inherited from interface jetbrains.buildServer.users.SUser
GUEST_USER_ID, SUPER_USER_ID, UKNOWN_USER_ID
-
-
Constructor Summary
Constructors Constructor Description AssociatedUser(long id, String realm, String account, String name, String email, Date lastLoginTimestamp, boolean hasPassword, UserChangesFacade changesFacade, SecurityContextEx securityContext, ServerResponsibility serverResponsibility, UserUpdate userUpdate, UserDataLoader userDataLoader, BlockStateManager blockStateManager, ProjectManagerEx projectManager, UserGroupManager userGroupManager, NotificationRulesManager notificationRulesManager, RolesManager rolesManager, RolesConverter rolesConverter, VcsUsernameStorage vcsUsernameStorage, NotificationRulesHolder notificationRulesHolder, PasswordComplexityChecker passwordComplexityChecker, String associatedEntityId, UserAttributeStorage userAttributeStorage)
-
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.voidapplyOrder(String notifierType, long[] ruleIds)Sorts the notification rules in the specified order.voiddeleteAttribute(String attributeKey)Delete user attributebooleanequals(Object o)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<NotificationRulesHolder>getAllParentRulesHolders()Returns all (direct and inherited) parent notification rules holdersStringgetAssociatedEntityId()StringgetAttribute(String attributeKey)Get user attributeList<NotificationRule>getNotificationRules(String notifierType)Returns the notification rules for specified notifier for this holder (user or group).List<NotificationRulesHolder>getParentRulesHolders()Returns direct parent notification rules holdersinthashCode()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.voidremoveRule(long ruleId)Removes the rule with specified id.voidremoveRule(NotificationRule rule)Removes the rule.voidsetAttribute(String attributeKey, String attributeValue)Set user attributevoidsetNotificationRules(String notifierType, List<NotificationRule> rules)Sets the notification rules for specified notifier.-
Methods inherited from class jetbrains.buildServer.users.impl.UserImpl
addRole, addVcsUsername, clearPermissions, deleteProperty, deleteUserProperty, getAdditionalGlobalPermissions, getAllModifications, getAllProjects, getAttributes, getBooleanProperty, getBuildTypesOrder, getDescriptiveName, getEmail, getExtendedName, getFilteredVisibleBuildTypes, getId, getLastLoginTimestamp, getName, getOrderedBuildTypes, getProjectsOrder, getProjectVisibilityHolder, getProperties, getPropertyValue, getRealm, getUsername, getVcsModifications, getVcsUsernames, getVerifiedEmail, getVisibleProjects, hasPassword, hideProject, hideProjects, init, isConfiguredVisibleProjects, isGuest, isHasHiddenProjects, isHighlightRelatedDataInUI, removeRole, removeRole, removeRoles, resetBuildTypesOrder, resetCachedAttributes, resetCachedProperties, resetCachedVcsUsernames, setBlockState, setBuildTypesOrder, setCreationInProgress, setDefaultVcsUsernames, setEmailIsVerified, setLastLoginTimestamp, setPassword, setProjectsOrder, setProperties, setProperty, setUserProperties, setUserProperty, setVcsRootUsernames, setVcsUsernames, setVcsUsernames, setVisibleProjects, toString, updateUserAccount
-
Methods inherited from class jetbrains.buildServer.users.impl.BaseUser
describe, getAllParentHolders, getAllUserGroups, getAllUserGroupsUnfiltered, getAssociatedUser, getBlockState, getGlobalPermissions, getOriginalAuthorityHolder, getParentHolders, getPermissionsGrantedForAllProjects, getPermissionsGrantedForAnyOfProjects, getPermissionsGrantedForProject, getProjectsPermissions, getRoles, getRolesWithScope, getScopes, getSecurityContext, getServerResponsibility, getUserGroups, getVcsUsernameProperties, hasAllPermissionsOf, isPseudoUser, isPseudoUserId, isSystemAdministratorRoleGranted, isSystemAdministratorRoleGrantedDirectly, isSystemAdministratorRoleInherited, resetBlocks, resetRoles, runWithRestrictor, updatePermissions
-
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, getAssociatedUser, getGlobalPermissions, getPermissionsGrantedForAllProjects, getPermissionsGrantedForAnyOfProjects, getPermissionsGrantedForProject, getProjectsPermissions, hasAllPermissionsOf
-
Methods inherited from interface jetbrains.buildServer.serverSide.auth.RolesHolder
getAllParentHolders, getParentHolders, getRoles, getRolesWithScope, getScopes, isSystemAdministratorRoleGranted, isSystemAdministratorRoleGrantedDirectly, isSystemAdministratorRoleInherited
-
Methods inherited from interface jetbrains.buildServer.users.SUser
getAllUserGroups, getBlockState, getUserGroups, getVcsUsernameProperties
-
Methods inherited from interface jetbrains.buildServer.users.impl.UserEx
getOriginalAuthorityHolder, isPseudoUser, resetBlocks, runWithRestrictor, runWithRestrictor, updatePermissions
-
Methods inherited from interface jetbrains.buildServer.users.impl.UserRolesInit
resetRoles
-
-
-
-
Constructor Detail
-
AssociatedUser
public AssociatedUser(long id, String realm, String account, String name, String email, Date lastLoginTimestamp, boolean hasPassword, @NotNull UserChangesFacade changesFacade, SecurityContextEx securityContext, ServerResponsibility serverResponsibility, @NotNull UserUpdate userUpdate, @NotNull UserDataLoader userDataLoader, BlockStateManager blockStateManager, ProjectManagerEx projectManager, UserGroupManager userGroupManager, NotificationRulesManager notificationRulesManager, RolesManager rolesManager, RolesConverter rolesConverter, VcsUsernameStorage vcsUsernameStorage, NotificationRulesHolder notificationRulesHolder, PasswordComplexityChecker passwordComplexityChecker, @NotNull String associatedEntityId, @NotNull UserAttributeStorage userAttributeStorage)
-
-
Method Detail
-
getNotificationRules
@NotNull public List<NotificationRule> getNotificationRules(@NotNull String notifierType)
Description copied from interface:NotificationRulesHolderReturns the notification rules for specified notifier for this holder (user or group).- Specified by:
getNotificationRulesin interfaceNotificationRulesHolder- Overrides:
getNotificationRulesin classBaseUser- Parameters:
notifierType- type of the notifier- Returns:
- list of notification rules for specified notifier
-
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- Overrides:
setNotificationRulesin classBaseUser- Parameters:
notifierType- type of the notifierrules- rules to save
-
removeRule
public void removeRule(long ruleId)
Description copied from interface:NotificationRulesHolderRemoves the rule with specified id.- Specified by:
removeRulein interfaceNotificationRulesHolder- Overrides:
removeRulein classBaseUser- 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- Overrides:
removeRulein classBaseUser- Parameters:
rule- rule to remove
-
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- Overrides:
applyOrderin classBaseUser- Parameters:
notifierType- type of the notifierruleIds- ids of the rules in the required order
-
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- Overrides:
addNewRulein classBaseUser- Parameters:
notifierType- type of the notifierrule- rule to add- Returns:
- the id of the newly created rule
- Throws:
DuplicateNotificationRuleException- if similar rule already exists
-
findConflictingRules
@Nullable 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- Overrides:
findConflictingRulesin classBaseUser- Parameters:
notifierType- type of the notifierwatch- watched builds- Returns:
- list of conflicting rules ids
-
findRuleById
@Nullable public NotificationRule findRuleById(long ruleId)
Description copied from interface:NotificationRulesHolderSearches for a rule with specified id.- Specified by:
findRuleByIdin interfaceNotificationRulesHolder- Overrides:
findRuleByIdin classBaseUser- 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- Overrides:
getParentRulesHoldersin classBaseUser- 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- Overrides:
getAllParentRulesHoldersin classBaseUser- Returns:
- all (direct and inherited) parent notification rules holders
-
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- Overrides:
isPermissionGrantedGloballyin classBaseUser- Parameters:
permission- permission to check- Returns:
- true or false
-
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- Overrides:
isPermissionGrantedForProjectin classBaseUser- 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- Overrides:
isPermissionGrantedForAllProjectsin classBaseUser- Parameters:
projectIds- collection of project idspermission- permission to check @return see above- See Also:
AuthorityHolder.isPermissionGrantedForProject(java.lang.String, jetbrains.buildServer.serverSide.auth.Permission)
-
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- Overrides:
isPermissionGrantedForAnyProjectin classBaseUser- 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 interfaceAuthorityHolder- Overrides:
isPermissionGrantedForAnyOfProjectsin classBaseUserpermission- permission to check- Returns:
- see above
-
setAttribute
public void setAttribute(@NotNull String attributeKey, @NotNull String attributeValue)Description copied from interface:UserExSet user attribute- Specified by:
setAttributein interfaceUserEx- Overrides:
setAttributein classUserImpl
-
getAttribute
@Nullable public String getAttribute(@NotNull String attributeKey)
Description copied from interface:UserExGet user attribute- Specified by:
getAttributein interfaceUserEx- Overrides:
getAttributein classUserImpl- Returns:
- user attribute or null if there is no attribute with such key
-
deleteAttribute
public void deleteAttribute(@NotNull String attributeKey)Description copied from interface:UserExDelete user attribute- Specified by:
deleteAttributein interfaceUserEx- Overrides:
deleteAttributein classUserImpl
-
getAssociatedEntityId
public String getAssociatedEntityId()
-
-