Need to disable "Publish" option under sharing

Evan2
Kilo Guru

Hi All,

 

I need to disable/hide "Publish" option under sharing of report. It is OOB feature but as per my requirement I want to disable/hide this. Kindly help. PFB the screenshot

 

find_real_file.png

 

Regards,

Nandan

15 REPLIES 15

Just remove the 'report_publisher' role then.  That's all you can do with this.  Grant 'report_publisher' (with itil), 'report_admin', or 'admin'.  If the user has any combination of those roles they will see the 'Publish' option.  If they don't, the option will be removed.

As this publish option provide direct link to the report so there is chance to security breach of data so I want to delete/disable this option for all.

There is no role constraint, I want to disable/delete it for all(even if possible to admin also).

You cannot remove that option from that page.  The only thing you could do would be to create a business rule on the sys_report table that checks to see if the 'roles' field contains the 'public' role and then abort the update.  That would prevent anything from ever being made public, but it won't remove the option from the front-end page.

Thanks for your support.

Can you please help me to write the correct business rule as I am unable to achieve it by myself.

Here's how you can prevent any report from being published.  You'll still see the 'Publish' link but this will prevent it from being saved.  A report is published any time it is saved with the 'public' role.  You can see the 'roles' field by navigating to the report table to verify.  The front-end UI will make it look like the report can be published...and has been published...but it won't actually save on the back-end.  It's not great, but it's the best you can do.

1) Navigate to 'Reports -> Administration -> All' in your left nav.

2) Right-click the list header and select 'Configure -> Business rules'

3) Create a new business rule with the following settings...

Name: Disallow publishing

Advanced: True

When: Before

Order: 1000 - This is important in order to abort correctly!

Insert/Update: True

Condition: current.roles.changes()

Script:

(function executeRule(current, previous /*null when async*/) {
	var roles = current.roles.getDisplayValue();
	if (roles !== null) {
		// Check for the 'public' role
		var n = roles.indexOf('public');
		if (roles.indexOf('public') > -1) {
			// If we find it abort the update
			gs.addErrorMessage("Cannot save as a public report. Please remove the 'public' role and try again.");
			current.setAbortAction(true);
		}
	}
})(current, previous);

Please mark my answer correct if I've answered your question.