on 08-27-2013 5:03 PM
Hi All,
Sometime back, I had requested for some database queries through which I can get a list of roles assigned to users in IDM 7.1.
Below is the query which I got:
select x.mskey, x.avalue, z.mskey, z.avalue from mxiv_sentries x, mxiv_sentries y, mxiv_sentries z
where x.mskey=y.mskey
and y.searchvalue= z.mskey
and y.attrname='MXREF_MX_ROLE'
and x.attrname='MSKEYVALUE'
and x.mskey in (select mskey from mxiv_sentries where attrname='MX_ENTRYTYPE' and searchvalue='MX_PERSON')
and z.attrname='MSKEYVALUE'
order by x.mskey
However, this query only gives the IDM Roles (MXREF_MX_ROLE) assigned to users but I want the privileges (MX_AUTO_PRIVILEGE) coming through IDM Role or privileges (MXREF_MX_PRIVILEGE) that are directly assigned to users, also to be included as well in query.
So basically I want query to return the User and IDM Roles assigned to it, along with Privileges coming through IDM Role and privileges that are directly assigned to user.
I am not an SQL expert, could anyone of you please help me modify above query or come up with new query.
Thanks...
So it would be the best to replace this line
and y.attrname='MXREF_MX_ROLE'
with
and y.attrname in ('MXREF_MX_ROLE', 'MXREF_MX_PRIVILEGE', 'MX_AUTOPRIVILEGE')
If you have further attributes you want to add, simply add another in the row
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Aditi,
If you just want privileges replace MX_MXREF_ROLE with MX_MXREF_PRIVILEGE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.