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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to set variables in section access?

I have created my section access like below. I need to know how to set a variable in section access and value will be different for each user.

I will be using this value to evaluate while logging in and will display or hide some functionality to that user.

Section Access;
LOAD * INLINE [
    ACCESS, USERID, PASSWORD
    ADMIN, ADMIN, ADMIN
    USER, USER1, USER1,
    USER, USER2, USER2
]
;

Thanks,

16 Replies
Not applicable
Author

Hey Steve,

Thank you very much for following up.

I did see your example. I can understand you have two users.

1) Admin with Admin Access

2) Admin2 with User Access

am not sure what your are referring as sheet in the "Section Access" and I am not sure why do we need to use it?

And in the "Section Application", you are assigning a role value for each sheet.

Is it not possible to assign the role value in the "Section Access" it self? Why do we need to go for another step?

I will look for a possible way having your example as base.

Not applicable
Author

Hi

Sheet could be called anything, it's just a field to indicate a certain level of authorisation, as defined below. It's not necessarily per sheet, the name I've used clouds the solution. SHEET is just a field, it could be sales area, department, xxx, anything, whatever makes sense for you...call it button?

I use the two steps for two reasons;

1) This allows for more complex and sophisticated scenarios, the example is a simple one.

2) I'm not sure just doing this in one step works. The section access is all hidden once a user accesses the report which  means the field you need disappears. But try this and let me know if one step works.

Let me know how you get on and let me know if you have any questions.

Steve

Not applicable
Author

Hi

I was wondering, did the above prove to be correct and solve your issue.  I hope it proved useful at least.

Let me know if you need it clarifying.


Steve

Not applicable
Author

Hi Steve,

Your example was really helpful and in fact, I tried something similar for my logic and it worked.

But my only issue here is, it is forcing me to create a separate table (to map section access users and their roles).

As I said before, there should be a way with the section access table alone. But I am yet to figure out appropriate solution for that. I will let you know once I derive that.

Thanks much for your help.

Thanks,

Raghuraman

Not applicable
Author

Steve,

I am finding an issue with your approach.

Below is the script I added for Section access and additional table for role_number

For User1 and User2, I have uncheck "Edit Script" options in tab  "Settings" - > "Document Properties" -> "Security".

But still I am able to see the edit script icon in the tool bar and in the File menu options.

This is allowing User1 and User2 to edit the script if they can.

Do you know how to disable "Edit Script" icon for User1 and User2?

Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, ROLE
    ADMIN, ADMIN, ADMIN, AD
    USER, USER1, USER1, US1
    USER, USER2, USER2, US2
]
;


Section Application;

Profile:
Load * INLINE [
ROLE, ROLE_NUMBER
AD, 0
US1, 1
US2, 2
]
;

Not applicable
Author

Hi

I'm not at my machine at the moment but, as memory serves, you will find this setting under Document Properties > Security.

However, I'd really recommend that you move this script to a hidden tab that is password protected to ensure your security model cannot be compromised. (In your script go to file > create hidden script and enter a password twice).

Regarda

steve

Not applicable
Author

I did that in the Documents Properties and unchecking the Edit Script option for USER.

But I am still able to see the icon when loged in as USER.

Hidden Script is an option to hide the section access, which I am doing now.