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.group
Interface GroupPermissionProvider

    public interface GroupPermissionProvider

Within interfaces of JReport security API, `GroupPermissionProvider` is used to provide customized permission setting of group. Except getting group permission setting from customer's external security system, this interface also provide ability to modify group permission setting in customer's external security system.

Since:
  version 8

Method Summary
`java.util.Hashtable` | `getGroupPermissions(java.lang.String realmName, java.lang.String resourcePath, int versionNumber)` Get all groups' permission setting attached to a specified resource or version node from customer's external secuirty system.
`boolean` | `isEnableEdit()` Indicates whether customer's external security system will be modified by invoking some methods in `GroupPermissionProvider`. In common cases, invokeing `setGroupPermissions()` should take effect on customer's external security system, and cause modification of external security system, this method should return `true` in such case.
`void` | `setGroupPermissions(java.lang.String realmName, java.lang.String groupName, java.lang.String resourcePath, int versionNumber, java.lang.String permissionString)` Set groups' permission setting for a specified resource or version node in customer's external secuirty system.

Method Detail

### getGroupPermissions

    java.util.Hashtable getGroupPermissions(java.lang.String realmName,
                                            java.lang.String resourcePath,
                                            int versionNumber)
                                            throws JRCustomerException

  Get all groups' permission setting attached to a specified resource or version node from customer's external secuirty system.

  Parameters:
    `realmName` - the realm name
    `resourcePath` - resource path to specify a resource
    `versionNumber` - version number of the resource, a valid version number should be a positive integer, if `versionNumber` less than 1, it means want to get permission setting attached to the resouce which specified by `resourcePath`.
  Returns:
    the groups' permission setting for specified resource or version node. The permission setting is a `Hashtable` contains several group/permissions pair to represent permissions attached to specified resorce/version. In this `Hashtable` object, key is group name, value is a `String` object to represent permission setting for this group, this string's length is 7, every character represent status of a specified permission, available value is `jet.cs.api.CSPermission.ALLOW` and `jet.cs.api.CSPermission.DENY` The structure of `Hashtable` is: ::= NULL | {, }... ::= a string of group name ::= {}... ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` In `CSPermission`, value of `DENY` is 0, value of `ALLOW` is 1, a permissionString has 7 chars and it could be like: 0110100
  Throws:
    `JRCustomerException` - If an error occurs during JReport server security system invoking this method, and the implementation think should throw this error to JReport server security system.

### setGroupPermissions

    void setGroupPermissions(java.lang.String realmName,
                             java.lang.String groupName,
                             java.lang.String resourcePath,
                             int versionNumber,
                             java.lang.String permissionString)
                             throws NoSuchGroupException,
                                    JRCustomerException

  Set groups' permission setting for a specified resource or version node in customer's external secuirty system.

  Parameters:
    `realmName` - the realm name
    `groupName` - the group name to specify a group want to set permissions
    `resourcePath` - resource path to specify a resource
    `versionNumber` - version number of the resource, a valid version number should be a positive integer, if `versionNumber` less than 1, it means want to set group permission for the resouce which specified by `resourcePath`.
    `permissionString` - permission string to represent permissions for this group, this string's length is 7, every character represent status of a specified permission, available value is `jet.cs.api.CSPermission.ALLOW` and `jet.cs.api.CSPermission.DENY` The structure of `permissionString` is: ::= {}... ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` ::= `CSPermission.DENY` | `CSPermission.ALLOW` In `CSPermission`, value of `DENY` is 0, value of `ALLOW` is 1, a permissionString has 7 chars and it could be like: 0110100.
    If the `permissionString` is `null`, means dont set specified group's permission for specified resource/version node.
    If the `permissionString`'s length is 0, means status of all permissions is `CSPermission.DENY`
  Throws:
    `NoSuchGroupException` - If there is no a group has specified name in customer's external security system.
    `JRCustomerException` - If an error occurs during JReport server security system invoking this method, and the implementation think should throw this error to JReport server security system.

### isEnableEdit

    boolean isEnableEdit()

  Indicates whether customer's external security system will be modified by invoking some methods in `GroupPermissionProvider`.
  In common cases, invokeing `setGroupPermissions()` should take effect on customer's external security system, and cause modification of external security system, this method should return `true` in such case. If cusotmer's external security system will not be affected by invoking `setGroupPermissions()`, this method should return `false`.
  Return value of method `isEditing()` with paramter `SecurityWebAdaptor.ACTION_EDIT_GROUP_PERMISSIONS` in `jet.server.api.SecurityWebAdaptor` is same with this method's return value.

  Returns:
    `true` if external security system will be affected by invoking `setGroupPermissions()`, 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