Page 1 of 1

DStageWrapper for extracting user/role/project

Posted: Wed Mar 13, 2019 4:23 am
by DamienF
Hello,

I'm currently trying to export witha command line the permissions of a project/list of projects.
I found here a beautifull command line :

DStageWrapper.sh -user myUser-password myPas -query "select x.principalId,a.contextId from x in ASCLModel::User, y in x->has_SystemRole, z in x->assignedBy_RoleAssignment, a in z->has_RoleContext, b in a->defines_RoleAssignment, c in b->definedBy_SystemRole where y.roleId = 'DataStageUser''"

I tried this and thought it was working fine.... but no, it gives me a wrong list. It gives me for one user all possible roles. I mean for user1, i get :
user1 developer
user1 operator
user1 superOperator

Even if this user is only operator on the project.

I tried and this is this part of the query which is making a cross join :
b in a->defines_RoleAssignment

Any one has an idea how to fix this query ? Or perhaps you have a better way to extract the permissions and roles for a project.

Thanks for your help on this one ! the documentation of DStageWrapper is almost ... inexistant.

Posted: Thu Mar 14, 2019 1:02 am
by qt_ky
Even years ago I said this query syntax was the "least/worst-ever-documented, ever."

The DStageWrapper and the DirectoryCommand tool options are discussed in these topics.

viewtopic.php?t=157954

viewtopic.php?t=154942

If you have explored those fully and still don't have what you need, then your best path would be to open a case with IBM Technical Support.

Posted: Thu Mar 14, 2019 10:00 pm
by DamienF
Thanks, i did not find one of those posts.
This query :

Query for user project permissions
Code:

Code: Select all

select U.principalId, P.contextId, R.roleId from U in ASCLModel::User, RA in U->assignedBy_RoleAssignment, P in RA->has_RoleContext, R in RA->definedBy_SystemRole order by U.principalId,P.contextId,R.roleId
Is doing exactly what i need !

Thanks !