jet.server.api.custom.security.group
Interface GroupPermissionProvider


public interface GroupPermissionProvider

Among the interfaces of JReport security API, GroupPermissionProvider is used to provide customized permission setting of group. In addition to getting group permission settings from customer's external security system, this interface also provides the ability to modify group permission setting in customer's external security system.


Method Summary
 java.util.Hashtable getGroupPermissions(java.lang.String realmName, java.lang.String resourcePath, int versionNumber)
          Gets all groups' permission settings attached to a specified resource or version node from customer's external security system.
 boolean isEnableEdit()
          Indicates whether customer's external security system will be modified by invoking some methods in GroupPermissionProvider.
In common cases, invoking setGroupPermissions() 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 setGroupPermissions(java.lang.String realmName, java.lang.String groupName, java.lang.String resourcePath, int versionNumber, java.lang.String permissionString)
          Sets groups' permission settings for a specified resource or version node in customer's external security system.
 

Method Detail

getGroupPermissions

java.util.Hashtable getGroupPermissions(java.lang.String realmName,
                                        java.lang.String resourcePath,
                                        int versionNumber)
                                        throws JRCustomerException
Gets all groups' permission settings attached to a specified resource or version node from customer's external security system.

Parameters:
realmName - the realm name.
resourcePath - the resource path to specify a resource.
versionNumber - the version number of the resource. A valid version number should be a positive integer. If versionNumber is less than 1, it means to get permission setting attached to the resource specified by resourcePath.
Returns:
the groups' permission settings for the specified resource or version node. The permission setting is a Hashtable containing several group/permissions pairs to represent permissions attached to the specified resource/version. In this Hashtable object, the key is group name, the value is a String object to represent permission setting for this group. This string's length is 7, and each character represents status of a specified permission. The available values are jet.cs.api.CSPermission.ALLOW and jet.cs.api.CSPermission.DENY.
The structure of Hashtable is:
  • <groupPermissionHt> ::= NULL | {<groupName>, <permissionString>}...
  • <groupName> ::= a string of group name
  • <permissionString> ::= {<visible><read><write><execute><schedule><delete><grant>}...
  • <visible> ::= CSPermission.DENY | CSPermission.ALLOW
  • <read> ::= CSPermission.DENY | CSPermission.ALLOW
  • <write> ::= CSPermission.DENY | CSPermission.ALLOW
  • <execute>::= CSPermission.DENY | CSPermission.ALLOW
  • <schedule> ::= CSPermission.DENY | CSPermission.ALLOW
  • <delete> ::= CSPermission.DENY | CSPermission.ALLOW
  • <grant> ::= CSPermission.DENY | CSPermission.ALLOW
In CSPermission, the value of DENY is 0, the value of ALLOW is 1. permissionString has 7 chars and it can be like: 0110100
Throws:
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.

setGroupPermissions

void setGroupPermissions(java.lang.String realmName,
                         java.lang.String groupName,
                         java.lang.String resourcePath,
                         int versionNumber,
                         java.lang.String permissionString)
                         throws NoSuchGroupException,
                                JRCustomerException
Sets groups' permission settings for a specified resource or version node in customer's external security system.

Parameters:
realmName - the realm name.
groupName - the group name to specify a group to set permissions.
resourcePath - the resource path to specify a resource.
versionNumber - the version number of the resource. A valid version number should be a positive integer. If versionNumber is less than 1, it means to set group permission for the resource specified by resourcePath.
permissionString - permission string to represent permissions for this group. This string's length is 7, and each character represents status of a specified permission. The available values are jet.cs.api.CSPermission.ALLOW and jet.cs.api.CSPermission.DENY.
The structure of permissionString is:
  • <permissionString> ::= {<visible><read><write><execute><schedule><delete><grant>}...
  • <visible> ::= CSPermission.DENY | CSPermission.ALLOW
  • <read> ::= CSPermission.DENY | CSPermission.ALLOW
  • <write> ::= CSPermission.DENY | CSPermission.ALLOW
  • <execute>::= CSPermission.DENY | CSPermission.ALLOW
  • <schedule> ::= CSPermission.DENY | CSPermission.ALLOW
  • <delete> ::= CSPermission.DENY | CSPermission.ALLOW
  • <grant> ::= CSPermission.DENY | CSPermission.ALLOW
In CSPermission, the value of DENY is 0, the value of ALLOW is 1. A permissionString has 7 characters and it can be like: 0110100.
If the permissionString is null, it means not to set the specified group's permission for the specified resource/version node.
If the permissionString's length is 0, it means status of all permissions is CSPermission.DENY
Throws:
NoSuchGroupException - If there is no group with the specified 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.

isEnableEdit

boolean isEnableEdit()
Indicates whether customer's external security system will be modified by invoking some methods in GroupPermissionProvider.
In common cases, invoking setGroupPermissions() 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 setGroupPermissions(), this method should return false.
Returned value of the method isEditing() with parameter SecurityWebAdaptor.ACTION_EDIT_GROUP_PERMISSIONS 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 setGroupPermissions(), otherwise return false.
See Also:
SecurityWebAdaptor