Example: Extending AbstractAuthorizationProvider

The listing below provides an illustration of Extending the AbstractAuthorizationProvider. Please refer to the API JavaDoc for more information about these classes.

Listing 2. Extending the AbstractAuthorizationProvider Class

public class MyAuthorization extends inetsoft.sree.security.AbstractAuthorizationProvider {

 

   public void setPermission(String resource,Permission perm) {

      // save the permission for a resource

   }

 

   public Permission getPermission(String resource) {

      // get the permission for a resource

   }

 

   public void removePermission(String resource) {

      // remove the permission for a resource

   }

 

   public void tearDown() {

      //teardown the security provider

   }

 

}

Note: In most cases using inetsoft's 'FileAuthorizationProvider' is a simpler and cleaner solution. Implement your own Authorization Provider only if you wish to store your access control information in a store other than a file, such as a DB, etc.

The resource names (for which you get and set permissions) are passed using the following syntax:

Resource Type

Resource Name

Replet

the name used to register the report in Enterprise Manager or during the Ad-Hoc report generation process

Replet Folder

folder name

Report in Archive

“_archive_” + report name

Folder in Archive

“_archive_” + folder name

Query

“_query_” + query_id

Task

“_task_” + task_id

Scheduler

“__inetsoft_schedule”

My Reports

“__inetsoft_myreports”

Ad Hoc Reporting

“__inetsoft_composer”

Dashboard Design

“__inetsoft_dashboard”

Viewsheet Design

“__inetsoft_viewsheet”

Worksheet Design

“__inetsoft_worksheet”

Note: Enterprise Manager authentication is integrated with Report Server authentication. When you set up an authentication provider other than the FileSecurityProvider, you can no longer log into the Enterprise Manager using the default 'admin/admin' credentials. You must log in as a user which has the 'Administrator' role. If there is no role named 'Administrator' in your system, you can change it to another role by adding the 'role.administrator' property in the 'sree.properties' file. e.g., role.administrator=SRAdmin.

<< Example: Extending AbstractAuthenticationProvider © 1996-2013 InetSoft Technology Corporation (v11.5) Porting Custom Security From v8.0 and Lower >>