You are not logged in.
Hi,
I want to write a script with incoming parameters: user (username) and apikey.
In script after I find such a user with given apikey, I want to find all reports (and their variants) where such a user has permissions (for example READ, EXECUTE).
As a result of the script I want to return reports keys and it's variants keys (or maybe also permission) as json.
I see in your source code how to read from object Report: Report Properties, Metadata, Paramters etc but I cannot find how to read Permissions?
What's more permissions can be granted also by group etc.
Could you give me some advises how to find reports where user has permission (directly or indirectly by group)?
Thank you in advance.
Offline
Hi,
Can I get any hints, please?
Offline
Hi Patryx,
have you checked the class net.datenwerke.security.service.security.SecurityService with all the checkRights() methods ?
E.g.: net.datenwerke.security.service.security.SecurityService.checkRights(User, SecurityTarget, Class<? extends Securee>, Class<? extends Right>...)
boolean hasAccess = securityService.checkRights(yourReport, SecurityServiceSecuree.class, Execute.class);
Regards,
Eduardo
Offline
Hi Eduardo,
Should I understand if I want to get all reports for which I have permission to execute, I have to go through all reports defined in reportserver and check each one if I have access?
Offline
Hi Patryx,
you can use the method net.datenwerke.rs.core.service.reportmanager.ReportService.getAllReports() for this.
Regards,
Eduardo
Offline
Hi Eduardo,
Thanks. Indeed I used net.datenwerke.rs.core.service.reportmanager.ReportService.getAllReports() to achieve my goal and then I checked rights for each report for expected user etc.
Last edited by Patryx (2019-07-02 11:11:03)
Offline