# com.bea.p13n.controls.securityProvider
GroupProviderControl Interface

public interface GroupProviderControl
extends `Control`

This control:

- is used as an interface to the Portal security provider functionality that is specific to groups.

Control properties:

- atnProvider The name of the authentication provider to perform these operations on. If not configured, the default authentication provider will be used.

Security requirements: These are determined by the roles specified on the AtnSecurityProvider MBean for the application. For example: ``

All Superinterfaces
  `Control`, `Control`, `Serializable`

## Method Summary

`public void` | `addGroupToGroup`(`String` parentGroup, `String` childGroup) Add a child group to a group
`public void` | `addUserToGroup`(`String` groupname, `String` username) Add a user to a group.
`public `ProfileWrapper`` | `createGroup`(`String` name)
`public `List`` | `getAllGroupNames`()
`public `List`` | `getChildGroupNames`(`String` groupname) Retrieve a list of all children of a group.
`public `List`` | `getGroupNamesForUser`(`String` username) Get a list of groups to which this user belongs
`public `List`` | `getParentGroupNames`(`String` groupname) Retrieve the parents of a group.
`public `List`` | `getTopLevelGroupNames`() Retrieve a list of groups that do not have parent groups.
`public `List`` | `getUsernamesForGroup`(`String` groupname)
`public `List`` | `getUsernamesForGroupLimited`(`String` groupname, `String` searchExpression, int limit) Retrieve a list of users in a group, matching the provided wildcard expression
`public boolean` | `groupExists`(`String` group) Determines if a group exists in the realm.
`public boolean` | `isDeletableGroup`(`String` groupName) Determine if a group can be deleted.
`public boolean` | `isDescendent`(`String` ancestor, `String` descendent) Determine if one group is a descendent of another.
`public boolean` | `isMemberOfGroup`(`String` groupname, `String` username, boolean recurse) Determine if a user is a member of a group.
`public void` | `removeGroup`(`String` groupname) Remove a group.
`public void` | `removeGroupFromGroup`(`String` parentGroup, `String` childGroup) Remove a child group from a group
`public void` | `removeUserFromGroup`(`String` groupname, `String` username) Remove a user from a group

## Method Detail

### addGroupToGroup(String, String) Method

    public void addGroupToGroup(String parentGroup,
                                String childGroup)
         throws OperationNotSupportedException

Add a child group to a group

#### Parameters

parentGroup
  the name of the group to modify

childGroup
  the name of the group to add

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### addUserToGroup(String, String) Method

    public void addUserToGroup(String groupname,
                               String username)
         throws OperationNotSupportedException

Add a user to a group.

#### Parameters

groupname
  the name of the group to modify

username
  the name of the user to add

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### createGroup(String) Method

    public ProfileWrapper createGroup(String name)
         throws GroupAlreadyExistsException, InvalidGroupnameException, OperationNotSupportedException, P13nControlException

#### Parameters

name
  name of the group to create

#### Exceptions

``GroupAlreadyExistsException``
  if the group already exists
``InvalidGroupnameException``
  if the group name is invalid
``OperationNotSupportedException``
  if authentication provider implementation does not support this operation
``P13nControlException``
  if remote errors occur

### getAllGroupNames() Method

    public List getAllGroupNames()
         throws OperationNotSupportedException

#### Returns

a List of all group names in the system

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### getChildGroupNames(String) Method

    public List getChildGroupNames(String groupname)
         throws OperationNotSupportedException

Retrieve a list of all children of a group.

#### Parameters

groupname
  the group to query

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### getGroupNamesForUser(String) Method

    public List getGroupNamesForUser(String username)
         throws OperationNotSupportedException

Get a list of groups to which this user belongs

#### Parameters

username
  Current user name

#### Returns

List of group names (String) to which the user belongs

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### getParentGroupNames(String) Method

    public List getParentGroupNames(String groupname)
         throws OperationNotSupportedException

Retrieve the parents of a group. Returns a List of parents, or null if there are none.

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### getTopLevelGroupNames() Method

    public List getTopLevelGroupNames()
         throws OperationNotSupportedException

Retrieve a list of groups that do not have parent groups. This will not return the built-in WLS "everyone" or "users" groups.

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### getUsernamesForGroup(String) Method

    public List getUsernamesForGroup(String groupname)
         throws OperationNotSupportedException

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### getUsernamesForGroupLimited(String, String, int) Method

    public List getUsernamesForGroupLimited(String groupname,
                                            String searchExpression,
                                            int limit)
         throws OperationNotSupportedException

Retrieve a list of users in a group, matching the provided wildcard expression

#### Parameters

groupname
  the group to query

searchExpression
  a wildcard expression to match

limit
  the maximum number of results to return

#### Returns

a List of usernames that are in this group

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### groupExists(String) Method

    public boolean groupExists(String group)
         throws OperationNotSupportedException

Determines if a group exists in the realm.

#### Parameters

group
  the group name to check

#### Returns

true if the group exists, false otherwise

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### isDeletableGroup(String) Method

    public boolean isDeletableGroup(String groupName)
         throws OperationNotSupportedException

Determine if a group can be deleted.

#### Returns

false if the group name given is protected by the system in any way

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### isDescendent(String, String) Method

    public boolean isDescendent(String ancestor,
                                String descendent)
         throws OperationNotSupportedException

Determine if one group is a descendent of another.

#### Parameters

ancestor
  see if the other group is a descendent of this group

descendent
  see if this is a descendent of the other group

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### isMemberOfGroup(String, String, boolean) Method

    public boolean isMemberOfGroup(String groupname,
                                   String username,
                                   boolean recurse)
         throws OperationNotSupportedException

Determine if a user is a member of a group.

#### Parameters

groupname
  the group to query

username
  the user to look for

recurse
  Extend search to descendents of groupName

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### removeGroup(String) Method

    public void removeGroup(String groupname)
         throws InvalidGroupnameException, OperationNotSupportedException

Remove a group. This will remove the group from both the realm and the profile tables.

#### Parameters

groupname
  name of the group to remove

#### Exceptions

``InvalidGroupnameException``
  if the group name is invalid
``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### removeGroupFromGroup(String, String) Method

    public void removeGroupFromGroup(String parentGroup,
                                     String childGroup)
         throws OperationNotSupportedException

Remove a child group from a group

#### Parameters

parentGroup
  the name of the group to modify

childGroup
  the name of the group to remove

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation

### removeUserFromGroup(String, String) Method

    public void removeUserFromGroup(String groupname,
                                    String username)
         throws OperationNotSupportedException

Remove a user from a group

#### Parameters

groupname
  the name of the group to modify

username
  the name of the user to remove

#### Exceptions

``OperationNotSupportedException``
  if authentication provider implementation does not support this operation