I'm developing a front-end to a client's SAS install along with some other services. I've been successful using the Viya 3.5 APIs to retrieve collections of reports, thumbnails, etc. using an admin account token. My main task, though, is to get a list of all reports that a given user is authorized to view. Any suggestions on how I would go about that? Ideally it would all be done with the REST APIs.
Hi @zmetz,
A colleague of mine mentioned the following:
If one has a list of all the reports, then one can use https://developer.sas.com/apis/rest/v3.5/CoreServices/#obtain-an-authorization-decision to get the decision on whether a user can read a report.
We should be able to use this API to get a list of reports: https://developer.sas.com/apis/rest/Visualization/#get-a-collection-of-reports.
I've not used auth decision API previously and I don't see a set of examples. Let's explore together if we can make calls to get the info you need. I'll also check with development to get more details on the API.
Thanks,
Joe
Join us for SAS Community Trivia
SAS Bowl XLVIII, All Things Models
Wednesday, February 19, 2024, at 10:00 a.m. ET | #SASBowl
Edit to add: I'm not so much looking for a code example as an approach to how I would collect this and match it up. I'm a little confused by the SAS terminology (principles, memberships) as I've just shifted from doing this same thing for Tableau. Again I'm running the API as an admin user. I'm collecting this information ahead of time into my applications DB, so I will have a table of users, table of reports, and a linking table, and that will all be updated periodically. Any help is appreciated!
Hi @zmetz,
A colleague of mine mentioned the following:
If one has a list of all the reports, then one can use https://developer.sas.com/apis/rest/v3.5/CoreServices/#obtain-an-authorization-decision to get the decision on whether a user can read a report.
We should be able to use this API to get a list of reports: https://developer.sas.com/apis/rest/Visualization/#get-a-collection-of-reports.
I've not used auth decision API previously and I don't see a set of examples. Let's explore together if we can make calls to get the info you need. I'll also check with development to get more details on the API.
Thanks,
Joe
Join us for SAS Community Trivia
SAS Bowl XLVIII, All Things Models
Wednesday, February 19, 2024, at 10:00 a.m. ET | #SASBowl
Thank you, @joeFurbee for your direction. I was able to accomplish this with an admin token and a combination of:
Then to determine what the user has read access to:
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.