Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Section access - security

Hi all,

in my app i have performance relevant data of all employees of a company.

i have for each employee the LogInName (Windows NTNAME) of the user as well as the level in the company's hierarchy.

What i want: I want to grant access to the data in my app based on the user's NTNAME and position in hierarchy.

Means: A user of the app can only see his / her own data (based on his / her LogInName) as well the data of people that are below this person.

Simple example:

Table USERS:

UserID
LogInName
FirstName
LastName
ManagerID
1DOMAIN\SmithJJohnSmith2
2DOMAIN\WallyTTroyWally4
3DOMAIN\CarterTTammyCarter2
4DOMAIN\BossDDarrenBoss4

Table PERFORMANCE:

PerformanceID
UserID
WeekYear
Performance
2211/2012Good
2312/2012Excelent
2413/2012Good
2521/2012Excelent
2622/2012Excelent
2723/2012Good
2831/2012Medium
2932/2012Medium
3032/2012Bad
3141/2012Good
3242/2012Excelent
3343/2012Good

The environment: The app is published on an access point. The server "knows" the NTNAME (LogInName) of each user.

So, if user John Smith is logged in, he should only be able to see the records in table PERFORMANCE where his ID is set as UserID. If Troy Wally is working with the app he should see the performance records of user 1, 3 and himself (2).

How would  do this using section access ?

How would i do it if i would want to add more data that is considered sensitive and shall be restricted ? (e.g. i add a table "PRSL. INFORMATION" and it should follow the same access rights as the PERFORMANCE table)

(Important to note: A person must not have access to any other data than the data that he / she is allowed to see.)

Thanks a lot for advise and hints.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I'm not sure I understand your hierarchy data correctly.  Anyway, in the structure I described yesterday, ID is pointing to the user who's logged in, and UserId is the user below the logged user in the hierarchy, on any level.  Obviously each user must have a record where he is presented in both fields - to see his own records.
How you build this table, is up to you.  You can use load inline, if the table is not big, or use data load with "hierarchy belongs to"

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Section access in your case must contain fields:
'USER' as ACCESS
upper(subfield(LoginName, '\')) as NTNAME
UserID as ID   (field name not important, but don't use USERID)

Section Application needs Hierarchy table containing two columns defining users hierarchy, fields ID and UserId:
ID  UserId
1  1
2  1
2  2
2  3
4  1
4  2
4  3
4  4

Field ID is a link between Section Access and Section Application, table Hierarchy
Field UserId is a link between table Hierarchy and table Performance (and additional tables if needed)

Regards,
Michael

Not applicable
Author

Thanks a lot. This already helps.

But the problem i ran into is: If i have a structure like this:

UserID
LogInName
FirstName
LastName
ManagerID
1DOMAIN\SmithJJohnSmith5
2DOMAIN\WallyTTroyWally4
3DOMAIN\CarterTTammyCarter2
4DOMAIN\BossDDarrenBoss2
5DOMAIN\CEOTheCEO5

Please consider the modified table above. In this hierarchy, if user John Smith is logged in, he

- cannot see his own performance records

- and he cannot see the performance records of Troy Wally

How can this be solved ?

Thanks a lot!!

Anonymous
Not applicable
Author

I'm not sure I understand your hierarchy data correctly.  Anyway, in the structure I described yesterday, ID is pointing to the user who's logged in, and UserId is the user below the logged user in the hierarchy, on any level.  Obviously each user must have a record where he is presented in both fields - to see his own records.
How you build this table, is up to you.  You can use load inline, if the table is not big, or use data load with "hierarchy belongs to"