Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jet.server.api.custom.security.relation
Interface GroupUserRelationProvider

    public interface GroupUserRelationProvider

Among the interfaces of JReport security API, `GroupUserProvider` is used to provide customized relation information among groups and users. In addition to getting relation information among groups and users from customer's external security system, this interface also provides the ability to modify relation information among groups and users in customer's external security system.

Since:
  version 8

Method Summary
`void` | `addUserToGroup(java.lang.String realmName, java.lang.String groupName, java.lang.String userName)` Adds a sub-user into the specified parent group in customer's external security system.
`java.util.Iterator` | `getSubUsers(java.lang.String realmName, java.lang.String groupName)` Gets sub-user names of the specified parent group from customer's external security system.
`boolean` | `isEnableEdit()` Indicates whether customer's external security system will be modified by invoking some methods in `GroupUserRelationProvider`. In common cases, invoking `addUserToGroup()` or `removeUserFromGroup()` should take effect on customer's external security system, and cause modification of external security system, this method should return `true` in such cases.
`void` | `removeUserFromGroup(java.lang.String realmName, java.lang.String groupName, java.lang.String userName)` Removes a sub-user from the specified parent group in customer's external security system.

Method Detail

### getSubUsers

    java.util.Iterator getSubUsers(java.lang.String realmName,
                                   java.lang.String groupName)
                                   throws NoSuchGroupException,
                                          JRCustomerException

  Gets sub-user names of the specified parent group from customer's external security system.

  Parameters:
    `realmName` - the realm name.
    `groupName` - the parent group name.
  Returns:
    sub-user names of the specified parent group.
  Throws:
    `NoSuchGroupException` - If there is no group that has the specified parent group name in customer's external security system.
    `JRCustomerException` - If an error occurs during JReport server security system invoking this method, and the implementation thinks this error should be thrown to JReport server security system.

### addUserToGroup

    void addUserToGroup(java.lang.String realmName,
                        java.lang.String groupName,
                        java.lang.String userName)
                        throws NoSuchGroupException,
                               NoSuchUserException,
                               UserExistsException,
                               JRCustomerException

  Adds a sub-user into the specified parent group in customer's external security system.

  Parameters:
    `realmName` - the realm name.
    `groupName` - the parent group name which will be added a sub-user to.
    `userName` - the sub-user name which will be added into the specified parent group
  Throws:
    `NoSuchGroupException` - If the specified parent group does not exist in customer's external security system.
    `NoSuchUserException` - If the specified sub-user does not exist in customer's external security system.
    `UserExistsException` - If the parent group contains a sub-user, which has the same name with `userName` in customer's external security system.
    `JRCustomerException` - If an error occurs during JReport server security system invoking this method, and the implementation thinks this error should be thrown to JReport server security system.

### removeUserFromGroup

    void removeUserFromGroup(java.lang.String realmName,
                             java.lang.String groupName,
                             java.lang.String userName)
                             throws NoSuchGroupException,
                                    NoSuchUserException,
                                    JRCustomerException

  Removes a sub-user from the specified parent group in customer's external security system.

  Parameters:
    `realmName` - the realm name.
    `groupName` - the parent group name, from which a sub-user will be removed.
    `userName` - the sub-user name which will be removed from the specified parent group
  Throws:
    `NoSuchGroupException` - If the specified parent group does not exist in customer's external security system.
    `NoSuchUserException` - If the specified sub-user does not exist in customer's external security system.
    `JRCustomerException` - If an error occurs during JReport server security system invoking this method, and the implementation thinks this error should be thrown to JReport server security system.

### isEnableEdit

    boolean isEnableEdit()

  Indicates whether customer's external security system will be modified by invoking some methods in `GroupUserRelationProvider`.
  In common cases, invoking `addUserToGroup()` or `removeUserFromGroup()` should take effect on customer's external security system, and cause modification of external security system, this method should return `true` in such cases. If customer's external security system will not be affected by invoking `addUserToGroup()` or `removeUserFromGroup()`, this method should return `false`.
  Returned value of the method `isEditing()` with parameter `SecurityWebAdaptor.ACTION_EDIT_RELATION_GROUP_USER` in `jet.server.api.SecurityWebAdaptor` is the same as this method's return value.

  Returns:
    `true` if external security system will be affected by invoking `addUserToGroup()` or `removeUserFromGroup()`, otherwise return `false`.
  See Also:
    `SecurityWebAdaptor`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD