Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Disable(lock) an object based on user login

Hi All,

I want to disable an object based on the logged in user.

For users logged in I am using section access.

Basically I am using a textbox with image and added two actions of set variable and Activate sheet.

I want to disable the textbox when a particular users get logged in.

How can I achieve this?? Could anyone help me on this??

Thanks,

Shailesh

8 Replies
tresesco
MVP
MVP

Text box right click->Layout tab-> Show conditional: Expression like:  =QvUser()<>'UserName'

ashfaq_haseeb
Champion III
Champion III

Hi.

Right Click on text box -->Layout --> Conditional

and write below code

If(osuser()='Doamin\User',1,0)

Then this will be only visible to user you specify above.

Regards

ASHFAQ

sujeetsingh
Master III
Master III

Looks that you need to take the list of users first from the User table and then use some macros to get the current logged UserID and then locking .

simenkg
Specialist
Specialist

You can use OSUser() in the conditional show of the text-box.

OSUser() returns DOMAIN\USERNAME.

Not applicable
Author


Hi,

In Layout Conditional property you may write If(USER='ABC',1,0)

I think this should work for you.

Not applicable
Author

Hi tresesco,

By doing that the textbox is hiding from that user.

I want to display the text box and user cannot be click on it.

ashfaq_haseeb
Champion III
Champion III

Hi,

I don't think that can be done.

Regards

ASHFAQ

tresesco
MVP
MVP

Well, in that case put a condition in your action, like:

=If(QvUser()<>'UserName', 'SheetID')    // for activating sheet action

Do similarly for variable setting action as well.