jet.server.api.custom.security
Interface AuthorizationProvider


public interface AuthorizationProvider

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

When using a customized user authorization scheme, user should:
1. Write a class which implements the interface jet.server.api.custom.AuthorizationProvider.
2. Put the class into the CLASSPATH used when launching JReport Server (JRServer.bat/sh).
3. Edit the file <SERVER PATH>/bin/server.properties, add a name/value pair, the name is custom.security.AuthorizationProvider and the value points to the customized class. or specify the customized class via -D parameter of the JVM, the name is com.jinfonet.AuthorizationProvider and the value points to the customized class.
4. Restart JReport Server and the customized user authentication will be used instead of the built in one.

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 the specific version of the 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 the specific version of the resource.

Parameters:
realmName - the realm name
userName - the user name
resourcePath - the resource path to check permission on
versionNumber - the version number of the resource specified by URI. A valid version number should be a positive integer. If versionNumber is less than 1, should check permission on the resourcePath.
permission - the permission 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_PUBLISH_REPORT, APIConst.PRIVILEGE_ACCESS_ADVANCED_PROPERTIES
Returns:
true if the user has the privilege