Your SAS programs, embedded in web apps and elsewhere

UserID Filter in Stored Processes

Posts: 0

UserID Filter in Stored Processes

Hi People,

I have a Stored Processes to calculate some metrics to return in a Report no Web Report Studio, but that report is visible to every user.

What I want is how can I use a filter to create restrictions by user. In Information Maps I use a prefilter and and the option "Derive identity values (for row level permissions) and SAS.Userid".

I have a table with the users and that table is connected to the factual by the keys.

Can anyone help me?

Super User
Posts: 5,434

Re: UserID Filter in Stored Processes

Posted in reply to deleted_user
Posts: 0

Re: UserID Filter in Stored Processes

Posted in reply to deleted_user
Good Documentation

but it did not help :s

In Information Maps i can do that, in Code i don't know how to do.

Posts: 8,868

Re: UserID Filter in Stored Processes

Posted in reply to deleted_user
In code, you could try to run the SP based on the automatic &_METAPERSON variable. Using SAS Macro programming techniques, you could code your stored process like this (assumes your "OK" code is packaged in an autocall macro program):

%if &_METAPERSON = Tom %then %do;
%else %if &_METAPERSON eq Jack %then %do;
%put You cannot handle this data. Try a different stored process.;

I wouldn't recommend this approach. For one thing, the %PUT will go to the LOG and users don't always have the LOG option turned on. I'm not even sure the log option is available in WRS. But, I still wouldn't recommend this approach -- if users change or leave, then you have to keep changing the stored process. And not all client applications set or use &_METAPERSON. And, coding this yourself, inside the SP, bypasses one of the major features of the platform.

The Enterprise Intelligence Platform has security -- that's one of the big features of having the metadata. I'd define a special group of users and then ONLY give members of that group authorization to run the SP. If users change or leave, you just have to change the membership in the group -- the SP is unchanged. You could even populate the data for the SP from an Information Map before the analysis is run. If you can put an authorization-based prefilter on the Information Map that populates the SP with data, you might not need the extra security on the SP.

Your best bet for help with this task may be to contact Tech Support. They can take a look at your SP and the analysis you want to surface conditionally and make specific suggestions based on what it is you need to do.

Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation