jet.server.api.custom.security
Interface AuthorizationProvider


public interface AuthorizationProvider

JReport Enterprise Server provides the ability to use customized user authorization scheme. Interface AuthorizationProvider provides ability to perform authorization check in customer's external security system.
Since version 7.1, customer can implement the interface jet.server.api.custom.security.AuthorizationProvider and import the customized class file by modifying the following JReport Enterprise Server's properties file:
<SERVER PATH>/bin/server.properties or by specifying jvm -D parameter.

When using customized user authorization scheme, user should:
1. Write a class which implements the interface jet.server.api.custom.AuthorizationProvider.
2. Put the class into CLASSPATH which used by launching JReport Enterprise Server
3. Edit file <SERVER PATH>/bin/server.properties, add a name/value pair, name is custom.security.AuthorizationProvider, value points to the customized class. or specify customized class via -D paramter of jvm, name is com.jinfonet.AuthorizationProvider, value pointes to the customized class.
4. Restart JReport Enterprise Server and the customized user authentication is working.

Since:
version 7.1
See Also:
AuthenticationProvider

Method Summary
 boolean checkPrivilege(java.lang.String realm, java.lang.String userID, java.lang.String privilege)
          Test if the user has the privilege
 boolean isPermissionOk(java.lang.String realmName, java.lang.String userName, java.lang.String resourcePath, int versionNumber, java.security.acl.Permission permission)
          Check if the user has the permission to do the action on specific version of resource
 

Method Detail

isPermissionOk

boolean isPermissionOk(java.lang.String realmName,
                       java.lang.String userName,
                       java.lang.String resourcePath,
                       int versionNumber,
                       java.security.acl.Permission permission)
Check if the user has the permission to do the action on specific version of resource

Parameters:
realmName - the realm name
userName - the user name
resourcePath - the resource path which we will check permission on it
versionNumber - version number of the resource that URI specified, a valid version number should be a positive integer, if versionNumber less than 1, should check permission on the resourcePath.
permission - permission want to check
Returns:
true if the user has the permission on the version.

checkPrivilege

boolean checkPrivilege(java.lang.String realm,
                       java.lang.String userID,
                       java.lang.String privilege)
Test if the user has the privilege

Parameters:
realm - the realm
userID - the user ID.
privilege - the privilege string, the available privileges are: APIConst.PRIVILEGE_CREATE_ANALYSIS_REPORT, APIConst.PRIVILEGE_PUBLISH_REPORT, APIConst.PRIVILEGE_ACCESS_ADVANCED_PROPERTIES
Returns:
true if the user has the privilege