Your SAS programs, embedded in web apps and elsewhere

Reading out metadata to get access information

Reply
Occasional Contributor
Posts: 12

Reading out metadata to get access information

We are not allowed in our company to use the SAS portal, but we were in need of a presentation layer for reports.

We made a stored process that read's out the metadata server to display the available stored processes and made a some code to make parameter selections available.

We call the stored process with the line below:
http://server/SASStoredProcess/do?_program=SBIP://Foundation/BIP%20Tree/Achmea/Intermediair/Web%20ra...

This gives us a nice presentation of the available stored processes. The only problem is that it does not display the stored processes for which the users are authorised. It display's the stored processes for the account that is allowed to execute the stored process on the sas server.

Is it possible to read out the metadata rights for the user who log's on to the webinterface? We know it's is possible to read out the metadata but than you need the userid and password and offcourse we don't know the password.
SAS Super FREQ
Posts: 304

Re: Reading out metadata to get access information

Posted in reply to Richardvan_tHoff
What release of SAS are you using?

Will using _ACTION=index work for you?

http://serverSmiley Tongueort/SASStoredProcess/do?_action=index

The servlet will list only stored processes that the authenticated is allowed to "see".

Vince DelGobbo
SAS R&D
Occasional Contributor
Posts: 12

Re: Reading out metadata to get access information

Posted in reply to Vince_SAS
We are using SAS 9.1.3 Service Pack 4.

We know about _action=index but that does not work for us. First of all if you click on a stored process you get a second screen we don't want that and we use some special code to make a selection screen.

It would be nice if we could see how the code behind _action=index works, and than in particular how to show only the information for which the user is authorized.

http://serverSmiley Tongueort/SASStoredProcess/do?_action=index the code behind this is java I think or am I wrong.
SAS Super FREQ
Posts: 304

Re: Reading out metadata to get access information

Posted in reply to Richardvan_tHoff

In SAS 9.2 you will have a connection to the metadata server under the correct identity (whoever you logged in as). Thus it seems your code will run properly under this release.



Do you have plans to migrate to 9.2?



The SAS Stored Process Web Application is written in Java, and the logic to create the index and property pages is self-contained. If you can program in Java, you can create a JSP page to replace the logic you are now doing in SAS.



One other option is to try running your code on a workspace server. I believe you will have a connection to the metadata server under the correct identity.



When you register the stored process, select "Transient package" for the output type. Then you will have to make some modifications to your code. I assumed that your stored process writes HTML to _WEBOUT. Here is some test code based on that assumption.



[pre]

*ProcessBody;

%let _ODSDEST=html;

%STPBEGIN;

ods html close;

* Replace the file named "main.html" in the STP work directory;

filename _webout "&_STPWORK.main.html";

data _null_;
file _webout;
* Your SAS code here ;
put '<h3>Hello World</h3>';
run;

%STPEND;
[/pre]



Vince DelGobbo


SAS R&D



Occasional Contributor
Posts: 11

Re: Reading out metadata to get access information

Posted in reply to Richardvan_tHoff
@ Vince,

When the code is running in a Workspace Server, there is no session available in which temporary data can be stored, like the library 'save' when using the Stored Process Server.

So what is best thing to do?
1. Keep the program running in a Stored Process Server. But then we need to know a way to display only those items for which the user is authorized. How do you do that? You need to know groupmembership and all that. Seems very complex, timeconsuming, etc. ...
2. Run the program in a Workspace Server. But what is the best way to store temporary data like you do when using the Stored Process Server. Keeping a file in the home-directory of the user or something?

Regards, Raoul. Message was edited by: Raoul
Ask a Question
Discussion stats
  • 4 replies
  • 275 views
  • 0 likes
  • 3 in conversation