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 long
addNewRule(String notifierType, NotificationRule rule)
Adds new rule to the rules of specified user for specified notifier type.void
applyOrder(String notifierType, long[] ruleIds)
Sorts the notification rules in the specified order.void
deleteAttribute(String attributeKey)
Delete user attributeboolean
equals(Object o)
Collection<Long>
findConflictingRules(String notifierType, WatchedBuilds watch)
Searches for rules which intersect with specified watched builds.NotificationRule
findRuleById(long ruleId)
Searches for a rule with specified id.List<NotificationRulesHolder>
getAllParentRulesHolders()
Returns all (direct and inherited) parent notification rules holdersString
getAssociatedEntityId()
String
getAttribute(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 holdersint
hashCode()
boolean
isPermissionGrantedForAllProjects(Collection<String> projectIds, Permission permission)
Returns true if permission is granted for all projects from the given list.boolean
isPermissionGrantedForAnyOfProjects(Collection<String> projectIds, Permission permission)
Returns true if specified permission is granted for at least one project from the given collectionboolean
isPermissionGrantedForAnyProject(Permission permission)
Returns true if specified permission is granted for at least one projectboolean
isPermissionGrantedForProject(String projectId, Permission permission)
Returns true if permission is granted for a project, i.e.boolean
isPermissionGrantedGlobally(Permission permission)
Returns true if specified permission granted globally (i.e.void
removeRule(long ruleId)
Removes the rule with specified id.void
removeRule(NotificationRule rule)
Removes the rule.void
setAttribute(String attributeKey, String attributeValue)
Set user attributevoid
setNotificationRules(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:NotificationRulesHolder
Returns the notification rules for specified notifier for this holder (user or group).- Specified by:
getNotificationRules
in interfaceNotificationRulesHolder
- Overrides:
getNotificationRules
in 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:NotificationRulesHolder
Sets the notification rules for specified notifier.- Specified by:
setNotificationRules
in interfaceNotificationRulesHolder
- Overrides:
setNotificationRules
in classBaseUser
- Parameters:
notifierType
- type of the notifierrules
- rules to save
-
removeRule
public void removeRule(long ruleId)
Description copied from interface:NotificationRulesHolder
Removes the rule with specified id.- Specified by:
removeRule
in interfaceNotificationRulesHolder
- Overrides:
removeRule
in classBaseUser
- Parameters:
ruleId
- id of the rule
-
removeRule
public void removeRule(@NotNull NotificationRule rule)
Description copied from interface:NotificationRulesHolder
Removes the rule. ThrowsNotificationRuleChangedException
if notification rule with same id was already changed. Does nothing if notification rule doesn't exist.- Specified by:
removeRule
in interfaceNotificationRulesHolder
- Overrides:
removeRule
in classBaseUser
- Parameters:
rule
- rule to remove
-
applyOrder
public void applyOrder(@NotNull String notifierType, @NotNull long[] ruleIds)
Description copied from interface:NotificationRulesHolder
Sorts the notification rules in the specified order.- Specified by:
applyOrder
in interfaceNotificationRulesHolder
- Overrides:
applyOrder
in 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 DuplicateNotificationRuleException
Description copied from interface:NotificationRulesHolder
Adds new rule to the rules of specified user for specified notifier type.- Specified by:
addNewRule
in interfaceNotificationRulesHolder
- Overrides:
addNewRule
in 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:NotificationRulesHolder
Searches for rules which intersect with specified watched builds.- Specified by:
findConflictingRules
in interfaceNotificationRulesHolder
- Overrides:
findConflictingRules
in 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:NotificationRulesHolder
Searches for a rule with specified id.- Specified by:
findRuleById
in interfaceNotificationRulesHolder
- Overrides:
findRuleById
in classBaseUser
- Parameters:
ruleId
- id of the rule- Returns:
- a found rule, or null
-
getParentRulesHolders
@NotNull public List<NotificationRulesHolder> getParentRulesHolders()
Description copied from interface:NotificationRulesHolder
Returns direct parent notification rules holders- Specified by:
getParentRulesHolders
in interfaceNotificationRulesHolder
- Overrides:
getParentRulesHolders
in classBaseUser
- Returns:
- direct parent notification rules holders
-
getAllParentRulesHolders
@NotNull public List<NotificationRulesHolder> getAllParentRulesHolders()
Description copied from interface:NotificationRulesHolder
Returns all (direct and inherited) parent notification rules holders- Specified by:
getAllParentRulesHolders
in interfaceNotificationRulesHolder
- Overrides:
getAllParentRulesHolders
in classBaseUser
- Returns:
- all (direct and inherited) parent notification rules holders
-
isPermissionGrantedGlobally
public boolean isPermissionGrantedGlobally(@NotNull Permission permission)
Description copied from interface:AuthorityHolder
Returns true if specified permission granted globally (i.e. not associated with any particular object)- Specified by:
isPermissionGrantedGlobally
in interfaceAuthorityHolder
- Overrides:
isPermissionGrantedGlobally
in classBaseUser
- Parameters:
permission
- permission to check- Returns:
- true or false
-
isPermissionGrantedForProject
public boolean isPermissionGrantedForProject(@NotNull String projectId, @NotNull Permission permission)
Description copied from interface:AuthorityHolder
Returns 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:
isPermissionGrantedForProject
in interfaceAuthorityHolder
- Overrides:
isPermissionGrantedForProject
in 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:AuthorityHolder
Returns true if permission is granted for all projects from the given list. Returns false if projectIds is empty.- Specified by:
isPermissionGrantedForAllProjects
in interfaceAuthorityHolder
- Overrides:
isPermissionGrantedForAllProjects
in 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:AuthorityHolder
Returns true if specified permission is granted for at least one project- Specified by:
isPermissionGrantedForAnyProject
in interfaceAuthorityHolder
- Overrides:
isPermissionGrantedForAnyProject
in classBaseUser
- Parameters:
permission
- permission to check- Returns:
- see above
-
isPermissionGrantedForAnyOfProjects
public boolean isPermissionGrantedForAnyOfProjects(@NotNull Collection<String> projectIds, @NotNull Permission permission)
Description copied from interface:AuthorityHolder
Returns true if specified permission is granted for at least one project from the given collection- Specified by:
isPermissionGrantedForAnyOfProjects
in interfaceAuthorityHolder
- Overrides:
isPermissionGrantedForAnyOfProjects
in classBaseUser
permission
- permission to check- Returns:
- see above
-
setAttribute
public void setAttribute(@NotNull String attributeKey, @NotNull String attributeValue)
Description copied from interface:UserEx
Set user attribute- Specified by:
setAttribute
in interfaceUserEx
- Overrides:
setAttribute
in classUserImpl
-
getAttribute
@Nullable public String getAttribute(@NotNull String attributeKey)
Description copied from interface:UserEx
Get user attribute- Specified by:
getAttribute
in interfaceUserEx
- Overrides:
getAttribute
in 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:UserEx
Delete user attribute- Specified by:
deleteAttribute
in interfaceUserEx
- Overrides:
deleteAttribute
in classUserImpl
-
getAssociatedEntityId
public String getAssociatedEntityId()
-
-