Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Section Access: What is the issue?

Hi everyone,

I want to reduce the content available by NT user - one user can see all the information but is only allowd see depot 6, and another user is allowed see all the depots, but not profit information.

I have viewed the questions on Section access and am trying to use OMIT in the Section Access script to remove the Profit information % and Profit from TESTUSER and have specified DEPOT as the field to reduce to Depot 6 for TESTUSER1.

section_access.png

'depot' is an entity attribute in the source db, and so I am loading it AS DEPOT

% and Profit are expressions used in tables in the document.

Neither are working  - TESTUSER1 can see all depots and TESTUSER can see all the profit information.

Much appreciated if anyone can point out where I'm going wrong.

4 Replies
maxgro
MVP
MVP

In the attachment an example;

below you can find the script with username and password (replace with NTNAME) to open the .qvw

look at Settings --> Document Properties --> Opening

Section Access

SECTION Application;

x:

load * inline [

ID, DEPOT, Profit

1, 1, 100

2, 2, 100

3, 3, 100

4, 4, 100

5, 5, 100

6, 6, 100

];

SECTION Access;

LOAD * inline [

ACCESS, USERID, PASSWORD, OMIT, DEPOT

USER, U1, 1, , 6

USER, U2, 2, Profit, *

ADMIN, MG, MG, , *

USER, U3, 3, , 1

USER, U3, 3, , 2

];

LOAD

  'USER' as ACCESS,

  'DUMMY' as USERID,

  'DUMMY' as PASSWORD,

  null() as OMIT,

  DEPOT

Resident x;

SECTION Application;

MK9885
Master II
Master II

Please find the attachment

USERID (just hit enter) and Password ADMIN

USERID- ALEX, Password- ABCD

USERID- JOHN, Password- BCDE

STAR is *;

SECTION Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, DEPOT, OMIT

    ADMIN, , ADMIN, *

    USER, ALEX, ABCD, 6

    USER, JOHN, BCDE, *, PROFIT

    USER, JOHN, , 1

    USER, JOHN, , 2

    USER, JOHN, , 3

    USER, JOHN, , 4

    USER, JOHN, , 5

];

SECTION Application;

LOAD * INLINE [

    DEPOT, PROFIT, USERNAME

    1, 345, ALEX

    2, 6765, JOHN

    3, 7689, ALEX

    4, 898, JOHN

    5, 21421, JOHN

    6, 6776, ALEX

];

Your script is correct I believe you did not check 'Initial Data Reduction Based on Section Access' in Document Settings hence your application is not applying any security rules.

Capture.PNG

Miguel_Angel_Baeyens

Section access works on fields, not expressions, so if "%" and "Profit" are expression labels, then yes, all of them will show up.

DEPOT must be the field name in lowercase in both the section access table and the data model table.

Not applicable
Author

Thanks Massimo, Aehman and Miguel for your replies.

They are very much appreciated.

I didn't have the Initial Data Reduction ... checkbox checked, and now the reduction by depot works.

Thanks for the screen shot Aehman.

Thanks for confirming that Expressions cant be included in Section Access OMIT,Miguel.

In that case, I will set a variable as OSUSER() and another as a HIDE variable that will be TRUE if certain OSUSERs are viewing the data and make the Expression conditional on the HIDE variable.

All the best,

Stefan