BookmarkSubscribeRSS Feed
lgsucupira
Fluorite | Level 6
Hi Cris,


How users were added and their respective permissions on folders and reports in VA, but we just saw that it is currently incorrect and we would like to change user permissions for folders and VA reports for all.
Researching we saw a possibility using SAS GUIDE but we did not get an efficient way.

original code

libname dirm 'S:\pgms\metalib';

%let mypw={ }

options metaserver = ""
metaport = 8561
metauser = ""
metapass = ""
metarepository = Foundation
metaprotocol = bridge
;

libname dirm 'F:\SAS_DATASETS\pgms\metalib';
libname dirt 'F:\SAS_DATASETS\pgms\metalib_target';
libname dirc 'F:\SAS_DATASETS\pgms\metalib_change';
libname dira 'F:\SAS_DATASETS\pgms\metalib_aplicar';

%mduextr(LIBREF=dirm);

proc sql;
create table VA_Grupos as
select NOME_GRUPO, Login_Usuario, displayname, memDesc, title from
(select memid, name as NOME_GRUPO, memName as Login_Usuario, memDesc from dirm.Groupmempersons_info) as a left join
(select objid, title, displayname from dirm.person) as b on a.memid=b.objid
order by NOME_GRUPO, displayname;
quit;

proc sql;
create table VA_Usuarios as
select keyid, displayname, name, description,title from dirm.person
order by displayname;
quit;

%mducmp(master=dirm, target=dirt, change=dirc);

proc sql;
create table grpmems as select * from dirm.Grpmems where grpkeyid='A5MZOL7U.A50000JG' and memkeyid='Larissa_Braga';quit;

proc sql;
insert into dirm.Grpmems select * from grpmems;quit;

%mduchglb(change=dirc);


%mdsecds(folder="/Fonte_de_Dados/", includesubfolders=yes);


%mdsecds(identitynames="sasdemo,PUBLIC", identitytypes="Person,IdentityGroup",
membertypes="Report", perms="WriteMetadata");

%mdsecds(identitynames="jose_ramos", identitytypes="Person", membertypes="Library",
perms="ReadMetadata");


thanks
6 REPLIES 6
ChrisNZ
Tourmaline | Level 20
So you want to set or reset the permissions programmatically?
Maybe change the title to describe the question more explicitly?
Moving the question to VA community.
SASKiwi
PROC Star

Updating SAS metadata is best done in SAS DATA steps, not in SQL, as you have a lot more control and can use the metadata read and update functions.

 

Here is the SAS Guide for this: Metadata Interface Guide 

 

Please bear in mind that the metadata data model is horribly complicated, and unraveling it is a steep learning curve. There is always the danger of corrupting the metadata repository if your updates don't work correctly. You should ALWAYS create a backup before you update - easy to do in SMC.

 

Personally I prefer to stick to configuring metadata in SMC. It's a lot easier and a lot less dangerous. However I'm lucky in that we only have a small number of SAS users so manual maintenance does not take long.

 

If you have a LOT of SAS users then automated metadata updates make a lot more sense. In this case you should be syncing your metadata users from Active Directory or Unix equivalent as that will save a huge amount of work and possibly avoid some of the permissions errors you are seeing. SAS provides programs for doing this.

 

lgsucupira
Fluorite | Level 6
exactly what programs does sas offer so that it can serve as support i am grateful!
SASKiwi
PROC Star

@lgsucupira  - The link I sent you contains examples of reading and updating SAS metadata. They are a good place to start. I also suggest you Google for SAS metadata examples also. The only supported programs I'm aware of are those mentioned in the documentation and the LDAP / AD account synchronisation with SAS metadata:

https://go.documentation.sas.com/?docsetId=bisecag&docsetTarget=p02wesbzrochnbn1na7fqdy2gdvo.htm&doc...

https://support.sas.com/kb/40/628.html

 

 

 

lgsucupira
Fluorite | Level 6
Hi SASKiwi
thank you very much, I am studying the content of the link, maybe I need some more help
SASKiwi
PROC Star

@lgsucupira - I have yet to find many use cases where the long and steep learning curve is worth it 😃. Good luck! Also please note that if you are planning to move to SAS Viya in the near future like many SAS users then the problem disappears - there is no metadata in Viya. We are planning such a move ourselves so it is pointless for us to spend a lot of time on understanding metadata structure.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1786 views
  • 1 like
  • 3 in conversation