Your SAS programs, embedded in web apps and elsewhere

UserID Filter in Stored Processes

Reply
N/A
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?

Regards,
João
Super User
Posts: 5,434

Re: UserID Filter in Stored Processes

Posted in reply to deleted_user
N/A
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.

Regards
SAS Super FREQ
Posts: 8,868

Re: UserID Filter in Stored Processes

Posted in reply to deleted_user
Hi:
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):
[pre]

%if &_METAPERSON = Tom %then %do;
%invoke_macro_code_for_OK;
run;
%end;
%else %if &_METAPERSON eq Jack %then %do;
%put You cannot handle this data. Try a different stored process.;
%end;
[/pre]

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.

cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 258 views
  • 0 likes
  • 3 in conversation