Package jetbrains.buildServer.groups
Interface UserGroupEx
-
- All Superinterfaces:
AuthorityHolder
,Comparable<UserGroup>
,Loggable
,NotificationRulesHolder
,PropertyHolder
,RolesHolder
,RolesHolderEx
,SPropertyHolder
,SUserGroup
,UserGroup
- All Known Implementing Classes:
AllUsersGroup
,SecuredUserGroup
,UserGroupImpl
public interface UserGroupEx extends SUserGroup, RolesHolderEx, SPropertyHolder, Comparable<UserGroup>
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addParent(UserGroup parent)
Adds the parent group.void
addSubgroups(Collection<UserGroup> subgroups)
Adds a set of subgroups atomicly.void
calculatePermissions(BitSet globalPerms, Map<String,Permissions> projectPerms)
Calculates the permissions of this user group and fillsglobalPerms
andprojectPerms
with results.void
cleanupGroup()
Removes from the group users, which were removed on the servervoid
dispose()
Removes all users, subgroups, etc from the group (and from DB).int
getUsersNumber()
Returns the number of (direct) users in this group.boolean
hasParents()
Returns whether this group has parent groups.boolean
isAllUsersGroup()
Returns true, if the specified group is the all-users group.void
removeParent(UserGroup parent)
Removes the parent group.void
resetRoles()
Resets internal roles cachevoid
updateInfo()
Reload main group info (name and description) from the databasevoid
updateProperties()
Reload group properties from the databasevoid
updateRoles()
Reload group roles from the databasevoid
updateSubgroups()
Reload group direct subgroups from the databasevoid
updateUsers()
Reload group users from the database-
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 java.lang.Comparable
compareTo
-
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.serverSide.auth.RolesHolderEx
getUnfilteredRoles, getUnfilteredScopes
-
Methods inherited from interface jetbrains.buildServer.users.SPropertyHolder
deleteProperty, setProperties, setProperty
-
Methods inherited from interface jetbrains.buildServer.groups.SUserGroup
addSubgroup, addUser, deleteGroupProperty, removeSubgroup, removeUser, setDescription, setGroupProperties, setGroupProperty, setName
-
Methods inherited from interface jetbrains.buildServer.groups.UserGroup
containsUserDirectly, getAllSubgroups, getAllUsers, getDescription, getDirectSubgroups, getDirectUsers, getKey, getName, getParentGroups
-
-
-
-
Method Detail
-
addParent
void addParent(@NotNull UserGroup parent)
Adds the parent group.Do not call this method directly! It should be consistent with
addSubgroup
.- Parameters:
parent
- the parent to add
-
removeParent
void removeParent(@NotNull UserGroup parent)
Removes the parent group.Do not call this method directly! It should be consistent with
removeSubgroup
.- Parameters:
parent
- the parent to remove
-
hasParents
boolean hasParents()
Returns whether this group has parent groups. Using this method is faster than!getParentGroups().isEmpty()
- Returns:
- true if this group has parent groups
-
addSubgroups
void addSubgroups(@NotNull Collection<UserGroup> subgroups) throws UserGroupException
Adds a set of subgroups atomicly. The same rules as inSUserGroup.addSubgroup(UserGroup)
apply.- Parameters:
subgroups
- the subgroups to be added- Throws:
UserGroupException
- in case of error (seeSUserGroup.addSubgroup(UserGroup)
)
-
getUsersNumber
int getUsersNumber()
Returns the number of (direct) users in this group. Much more effective thangetDirectUsers().size()
.- Returns:
- the number of users in the group
-
dispose
void dispose()
Removes all users, subgroups, etc from the group (and from DB).Useful when the group is deleted.
-
calculatePermissions
void calculatePermissions(@NotNull BitSet globalPerms, @NotNull Map<String,Permissions> projectPerms)
Calculates the permissions of this user group and fillsglobalPerms
andprojectPerms
with results.- Parameters:
globalPerms
- will contain global permissionsprojectPerms
- will contain project permissions
-
isAllUsersGroup
boolean isAllUsersGroup()
Returns true, if the specified group is the all-users group.- Parameters:
group
- the group to check- Returns:
- true if the specified group is the all-users group, false otherwise
- Since:
- 9.0
-
updateInfo
void updateInfo()
Reload main group info (name and description) from the database
-
updateProperties
void updateProperties()
Reload group properties from the database
-
updateUsers
void updateUsers()
Reload group users from the database
-
updateRoles
void updateRoles()
Reload group roles from the database
-
updateSubgroups
void updateSubgroups()
Reload group direct subgroups from the database
-
resetRoles
void resetRoles()
Resets internal roles cache
-
cleanupGroup
void cleanupGroup()
Removes from the group users, which were removed on the server- Since:
- 2023.11
-
-