Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI,
I have a requirement to implement column level security, I need your help
for instance I have 6 columns in the report with permission to everything for ID 1 and 2
Id Name Product Sales Profit Region
1 abc xyz 100 20 US East
2 dfr 123 200 30 US West
But I need to restrict the access on columns sales and profit for Id 2 and display "No Access" instead of leaving blank space
1 abc xyz 100 20 US East
2 dfr 123 No Access No Access US West
How can I achieve this, please help me.
Thanks,
Raj
In this scenario, the Sales and Profit columns are hidden from user 2 by display condition.
Script
Section Access;
LOAD * INLINE [
ACCESS, USERID, PASSWORD, REGION
ADMIN, ADMIN, ADMIN,*
USER, 1, P1, US EAST
USER, 2, P2, US WEST
];
Section Application;
star is *;
UserColumnMapping:
LOAD
*
INLINE [
USERID,SECID ,SECNAME, SECPRODUCT, SECSALES, SECPROFIT, SECREGION
1, 1, 1, 1, 1, 1, 1
2, 1, 1, 1, 0, 0, 1
];
DATA:
LOAD * INLINE [
ID,NAME,PRODUCT,SALES,PROFIT,REGION
1, abc, xyz, 100, 20, US EAST
2, dfr, 123, 200, 30, US WEST
];
Condition
Output
Hi Peter,
Thanks for the reply.
But my requirement is, it should not change the structure of the Table. we should show the metadata (the column names)
If you Login as Peter, you will have all the access to all the data
Id | Name | Product | Sales | Profit | Region |
1 | abc | xyz | 100 | 20 | US East |
2 | dfr | 123 | 200 | 30 | US West |
If I login as Raj,
the table structure should be same and I should not able to see the Sales and Profit Info and instead of blank space I need to show "No access" message
Id | Name | Product | Sales | Profit | Region |
1 | abc | xyz | No Access | No Access | US East |
2 | dfr | 123 | No Access | No Access | US West |
any insight would be appreciated.
Thank you,
Raj.
In that case, do away with Region (reduction field) and the structure is maintained.
The resultant table when Raj logs in doesn't display the Sales and Profit Info.
I'm yet to see a scenario describing the latter requirement, as in showing a message when columns are restricted.
Hi @sjar1290
You need to use Section Access OMIT option to completely ensure the field is not available for the given user
https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Security.htm
For the UI part you might need to use a separate function to display the custom text.
Hope it helps!
Hi Nadia,
Thank you for the reply.
Is there any way we write some function at the script to display the custom text, instead of using function in UI side to display custom text? because we need to educate all the app developers to write the function at the UI side for many number of columns we need to restrict the access, that's going to be a hell of a challenge.
any help would be appreciated.
Thanks,
Raj.