List access rights to all modules in a database using dxl

I am trying to generate a list of access rights of all the modules within a database.

Basically, create a list as below.
Module Name | Path | Username | Access Rights
=============================================================
Module1 | /path1 | User 1 | RMCDA
| User 2 | RMCD
| User n | RM


Module2 | /path2 | User 1 | RMC
| User 2 | RMCDA
| User n | R

Module3 | /path3 | User 1 | R
| User 2 | R
| User n | R


Just checking if anyone has done something like this or similar using dxl scripts?

Thanks,
Parin
Parin - Mon Jan 03 19:52:56 EST 2011

Re: List access rights to all modules in a database using dxl
PDU - Tue Jan 04 01:11:55 EST 2011

Like that ?
 

//    Report Access Rights on All Items
 
/*
        This script loops through all Items ( Projects, Folders, and Modules ) 
        below the current folder or project, and reports on Access Rights. 
        
        It does not attempt to open Modules and get any Access Right 
        information from inside the Modules.
        
        You can add your own checks for the specific Access Rights you 
        are looking for, and update the output of the script accordingly. 

        Tony Goodman.
*/
 
void recurseFolders( Item parentItem ) {
   string itemType = type( parentItem )
   if ( ( itemType == "Folder" ) || ( itemType == "Project" ) ) {
      Item childItem
      for childItem in folder( parentItem ) do {
         recurseFolders( childItem )
      }
   }
   
   print itemType ":\t"
   print fullName( parentItem ) "\t" uniqueID( parentItem ) "\n"
 
   AccessRec ar
   for ar in all parentItem do {
 
      if ( isDefault( ar ) ) {
         print "\tDefault"
      }
      else {
         print "\t" username( ar )
      }
      print " ("
      string r = ((read ar) ? "R" : "")
      string m = ((modify ar) ? "M" : "")
      string c = ((create ar) ? "C" : "")
      string d = ((delete ar) ? "D" : "")
      string a = ((control ar) ? "A" : "")
 
      string accessStr =  r m c d a ""
      if ( null accessStr ) accessStr = "None"
      print accessStr
      print ")"
      print "\n"
   
   }  
}
 
recurseFolders(item(fullName current Folder))


Pierre

Re: List access rights to all modules in a database using dxl
Parin - Thu Jan 06 17:23:59 EST 2011

PDU - Tue Jan 04 01:11:55 EST 2011

Like that ?
 

//    Report Access Rights on All Items
 
/*
        This script loops through all Items ( Projects, Folders, and Modules ) 
        below the current folder or project, and reports on Access Rights. 
        
        It does not attempt to open Modules and get any Access Right 
        information from inside the Modules.
        
        You can add your own checks for the specific Access Rights you 
        are looking for, and update the output of the script accordingly. 

        Tony Goodman.
*/
 
void recurseFolders( Item parentItem ) {
   string itemType = type( parentItem )
   if ( ( itemType == "Folder" ) || ( itemType == "Project" ) ) {
      Item childItem
      for childItem in folder( parentItem ) do {
         recurseFolders( childItem )
      }
   }
   
   print itemType ":\t"
   print fullName( parentItem ) "\t" uniqueID( parentItem ) "\n"
 
   AccessRec ar
   for ar in all parentItem do {
 
      if ( isDefault( ar ) ) {
         print "\tDefault"
      }
      else {
         print "\t" username( ar )
      }
      print " ("
      string r = ((read ar) ? "R" : "")
      string m = ((modify ar) ? "M" : "")
      string c = ((create ar) ? "C" : "")
      string d = ((delete ar) ? "D" : "")
      string a = ((control ar) ? "A" : "")
 
      string accessStr =  r m c d a ""
      if ( null accessStr ) accessStr = "None"
      print accessStr
      print ")"
      print "\n"
   
   }  
}
 
recurseFolders(item(fullName current Folder))


Pierre

That is exactly what I was looking for. Thanks, Pierre! Much appreciated.

-Parin

Re: List access rights to all modules in a database using dxl
SystemAdmin - Thu Jun 28 09:43:31 EDT 2012

Parin - Thu Jan 06 17:23:59 EST 2011
That is exactly what I was looking for. Thanks, Pierre! Much appreciated.

-Parin

Can anyone Please tell me the syntax if we want to exclude the access rights for modules .

Re: List access rights to all modules in a database using dxl
Mathias Mamsch - Fri Jun 29 18:08:42 EDT 2012

SystemAdmin - Thu Jun 28 09:43:31 EDT 2012
Can anyone Please tell me the syntax if we want to exclude the access rights for modules .

if this case you would insert:
 

...
if (type parentItem == "Formal" || type parentItem == "Link") return 
...

 


in the recurseFolders function. Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS