Solved

Check Group Membership

Posted on 2015-01-30
2
103 Views
Last Modified: 2015-02-02
Is there an easy way to check to see if a user is member of a group within a CL?

I want to check to see if a user is a member of a specific group -- but wasn't sure how exactly to do this.

Any help would be much appreciated.

Thanks!
0
Comment
Question by:Matthew Roessner
2 Comments
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 500 total points
ID: 40580023
Here's a rough example:

DCL &PRIGRP *CHAR 10
DCL &SUPGRP *CHAR 150
DCL &GROUP *CHAR 10 value('QSECOFR')
RTVUSRPRF USRPRF(SOMEUSER) GRPPGM(&GROUP)  SUPGRPPRF(&SUPPLEMENTAL)
IF ((&PRIGRP *EQ &MEMBER) *OR (%SCAN(&GROUP &SUPGRP *NE 0))) THEN DO
...

One note:  &SUPGRP is one big long string containing up to 15 supplemental group profiles.  Each profile starts in a fixed position:  position1, position 11, position 21, etc.  It is technically possible to get a false positive:

Group = 'APR'
Supgrp = 'PROFILE00APROFILE00BPROFILE00C'

%SCAN would find APR in position 10.

So you'll need to get a little fancier in production code: maybe write a little loop that extracts 10 bytes at a time and tests them, or test the position returned by %SCAN to verify that it ends in a "1".
0
 
LVL 1

Author Closing Comment

by:Matthew Roessner
ID: 40583858
Thanks for the direction Gary
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

A safe way to clean winsxs folder from your windows server 2008 R2 editions
Moving applications to the cloud or switching services to cloud-based ones, is a stressful job.  Here's how you can make it easier.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now