BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zmetz
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION

Accepted Solutions
joeFurbee
Community Manager

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 XXXVIII, SAS Programming: Getting Started
Wednesday, February 14, 2024, at 10 a.m. ET | #SASBowl

View solution in original post

3 REPLIES 3
zmetz
Fluorite | Level 6

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!

joeFurbee
Community Manager

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 XXXVIII, SAS Programming: Getting Started
Wednesday, February 14, 2024, at 10 a.m. ET | #SASBowl

zmetz
Fluorite | Level 6

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:

  • API "authorization/decisions" passing: { "request": { "uri": "[uri]", "method": "GET" }, "principals": [ { "name": "[name]", "type": "user" } ], "permission": "read" }

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1407 views
  • 3 likes
  • 2 in conversation