Focal Point
[CLOSED] UserID and GroupID variable in MR report

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3617063116

October 20, 2011, 05:46 AM
Sunilk
[CLOSED] UserID and GroupID variable in MR report
I have a dashboard report which pulls data from masterfiles and also have SQL reports.
I need to ristrict users of different groups to see only those records from the tables which has GRP_ID = . GRP_ID being a column in all the tables.
Is there a inbuilt focus variable which i can use as a where(in where/if statement) clause to all the reports in the dashboard so that the value of the variable would be applied to the report at runtime with the groupID of the user.

This message has been edited. Last edited by: Kerry,


WebFocus 7.7.02
Windows, All Outputs
October 20, 2011, 08:55 AM
rfbowley
I woudl suggest one of two approaches. If each user can only be a member of one group,

 
TABLE FILE security_table
PRINT GRP_ID
WHERE USER_ID EQ &IBIMR_user
ON TABLE HOLD AS TEMPGRP FORMAT ALPHA
END
-RUN
-READ TEMPGRP GRP.Ann.
 


&GRP would hold the group id for that user
and you can use

 
WHERE GRP_ID EQ &GRP;
 

or, if a user can be a member of multiple groups:
 

TABLE FILE security_table
PRINT GRP_ID
WHERE USER_ID EQ &IBIMR_user
ON TABLE HOLD AS TEMPGRP FORMAT ALPHA
END
-RUN
 


and use

 
WHERE GRP_ID IN FILE TEMPGRP
 


In either case, just use a -INCLUDE to put the query that creates TEMPGRP in the begining of each report fex, and the appropriate where statement along with the other where's.


Robert F. Bowley Jr.
Owner
TaRa Solutions, LLC

In WebFOCUS since 2001