Announcement

Migration of this forum

Dear users of this forum,

we are pleased to inform you that we will be updating the software behind this forum in the near future.

Existing posts, users and categories will remain untouched.

Important:

  • Each user will need to reset their password.
  • Please select "I forgot my password".
  • Enter the email address you used to register in this forum.
  • You will receive an email with a link to set a new password.
  • Please choose a new (secure) password and confirm the process.

We will keep you informed in the pinned thread.

Kind regards,
Your ReportServer Team


Migration des Forums

Liebe Nutzer dieses Forums,

wir freuen uns, euch mitteilen zu können, dass wir in naher Zukunft die Software hinter diesem Forum aktualisieren werden.

Existierende Beiträge, Nutzer und Kategorien bleiben weiterhin bestehen!

Wichtig:

  • Jeder Nutzer muss sein Passwort neu vergeben.
  • Wählt dazu einfach "Ich habe mein Passwort vergessen".
  • Gebt die E-Mail-Adresse ein, mit der ihr registriert seid.
  • Ihr erhaltet eine E-Mail mit einem Link zur Passwortvergabe.
  • Bitte wählt ein neues (sicheres) Passwort und bestätigt den Vorgang.

Wir halten euch im angepinnten Beitrag auf dem Laufenden!

Mit vielen Grüßen
Euer ReportServer Team

#1 2019-06-13 13:02:28

Patryx
Member
Registered: 2019-03-25

Script - how to find all allowed reports for given user?

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

#2 2019-06-19 09:31:34

Patryx
Member
Registered: 2019-03-25

Re: Script - how to find all allowed reports for given user?

Hi,
Can I get any hints, please?

Offline

#3 2019-06-20 16:56:57

IF_Eduardo
Administrator
Registered: 2016-11-01
Website

Re: Script - how to find all allowed reports for given user?

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

#4 2019-06-27 10:49:54

Patryx
Member
Registered: 2019-03-25

Re: Script - how to find all allowed reports for given user?

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

#5 2019-07-02 09:03:01

IF_Eduardo
Administrator
Registered: 2016-11-01
Website

Re: Script - how to find all allowed reports for given user?

Hi Patryx,

you can use the method net.datenwerke.rs.core.service.reportmanager.ReportService.getAllReports() for this.

Regards,
Eduardo

Offline

#6 2019-07-02 10:48:48

Patryx
Member
Registered: 2019-03-25

Re: Script - how to find all allowed reports for given user?

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

Board footer

Powered by FluxBB