Jump to content
We've recently updated our Privacy Statement, available here ×

Access Control


mhustler

Recommended Posts

Is there a way to change the default privileges for created objects in JasperServer?

 

I would like to configure reports and report options to be created with default privileges such that only the creator and the administrators have RW access.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 2 years later...

I have extended the JS base code in my own customizations project to alter the default behavior for saving report options. My implementation has the same requirement as the original author's organization where only the creating user and superusers should only have access to their own saved objects.

Link to comment
Share on other sites

  • 8 months later...

Hi,

I wrote a static method in a new custom class which accepts a Resource object (the base class of all JS objects such as report units, saved input control values, topics, ad hoc reports, folders, scheduled report output, etc...) and sets the permissions on that object. Look in the JS documentation - namely the JasperServer Ultimate Guide - under the section for "Object Permissions API" for some example code.

Permissions can be set on a object in two ways - role-based and user-based. You specify which one in your call to the method setPermissionRecipient in the ObjectPermission class. You'll see this in the documentation. Calling setPermissionMask allows you to specify the permission you want to set. The values you can enter here are:

0 for NO_ACCESS

2 for READ_ONLY

18 for READ_DELETE

30 for READ_WRITE_DELETE

1 for ADMINISTER

These values are listed in one the objPermissionToRole.jsp and objPermissionToUser.jsp files in the project

After you write your method, you will need to find the integration points within the code base for each resource type. In other words, you will need to look for where each of the resource types are being saved or copied and then call your custom method to change the default permissions.

Hope this helps...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...