jetbrains.buildServer.groups
Interface SUserGroup

All Superinterfaces:
AuthorityHolder, NotificationRulesHolder, RolesHolder, UserGroup

public interface SUserGroup
extends UserGroup, NotificationRulesHolder, RolesHolder, AuthorityHolder

Represents TeamCity-server user group interface.

Since:
4.5
Author:
Maxim Podkolzine (maxim.podkolzine@jetbrains.com)

Method Summary
 void addSubgroup(UserGroup group)
          Adds a subgroup to this group.
 void addUser(User user)
          Adds a user to this group.
 void removeSubgroup(UserGroup group)
          Removes a direct subgroup.
 void removeUser(User user)
          Removes a user from this group.
 void setDescription(java.lang.String description)
          Sets the group description.
 void setName(java.lang.String name)
          Sets the group name.
 
Methods inherited from interface jetbrains.buildServer.groups.UserGroup
getAllSubgroups, getAllUsers, getDescription, getDirectSubgroups, getDirectUsers, getKey, getName, getParentGroups
 
Methods inherited from interface jetbrains.buildServer.notification.NotificationRulesHolder
addNewRule, applyOrder, findConflictingRules, findRuleById, getNotificationRules, getParentRulesHolders, removeRule, setNotificationRules
 
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.AuthorityHolder
getAssociatedUser, getGlobalPermissions, getPermissionsGrantedForProject, getProjectsPermissions, isPermissionGrantedForAnyProject, isPermissionGrantedForProject, isPermissionGrantedGlobally
 

Method Detail

setName

void setName(@NotNull
             java.lang.String name)
             throws UserGroupException
Sets the group name.

Note: group name must be unique among all user groups. If name already exists, an exception is thrown.

The name cannot be empty and cannot exceed 255 characters.

Parameters:
name - the new group name
Throws:
UserGroupException - if name already exists, or is empty, or is too long
See Also:
UserGroup.getName()

setDescription

void setDescription(@NotNull
                    java.lang.String description)
                    throws UserGroupException
Sets the group description.

The description cannot exceed 2000 characters.

Parameters:
description - the new description
Throws:
UserGroupException - if description is too long
See Also:
UserGroup.getDescription()

addSubgroup

void addSubgroup(@NotNull
                 UserGroup group)
                 throws UserGroupException
Adds a subgroup to this group. Does nothing if the subgroup is already included directly.

User group cycles by inclusion are not permitted. An attempt to create a cycle results in exception.

Parameters:
group - a subgroup to add
Throws:
UserGroupException - if addition of the subgroup leads to a cycle

removeSubgroup

void removeSubgroup(@NotNull
                    UserGroup group)
Removes a direct subgroup. Does nothing if the subgroup is included indirectly.

Parameters:
group - a subgroup to remove

addUser

void addUser(@NotNull
             User user)
Adds a user to this group. Does nothing if the user is already included into this group directly.

Parameters:
user - the user to add

removeUser

void removeUser(@NotNull
                User user)
                throws UserGroupException
Removes a user from this group. Does nothing if the user is not included into this group directly.

The user isn't allowed to remove himself from any group.

Parameters:
user - a user to remove
Throws:
UserGroupException - if user is the authority holder, trying to remove himself