Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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,
Not really sure what you want achieve with these variables - variables have at one time always one value. Perhaps this is helpful for you: Introduction to Section Access
- Marcus
Hi
I believe you are looking for some like the attached. You just need to add an additional field to your section access and then use this to drive a 'variable' (within the second table) which is used in the Conditional show of the sheets (or anywhere else the conditional show functionality exists or use it to drive a flag).
The code is as follows;
Section Access;
LOAD * INLINE [
ACCESS, USERID, PASSWORD, SHEET
ADMIN, ADMIN, ADMIN, MS
USER, ADMIN2, ADMIN2, SS
];
Section Application;
Profile:
Load * INLINE [
SHEET, ThisRole
MS, 1
SS, 0]
;
Let me know how you get on, but I think this is the correct answer - am I right?
Regards
Steve
Thanks for your reply.
Basically, I want to restrict display of few buttons in my applications based on the type of user logging in.
So, I am planning to display the button if the variable value corresponds to that particular user.
As you mentioned, I want to have constant value for that variable that determines the type of user logging in.
Steve, thanks for your reply.
This looks to be something similar. But as I mentioned before.
I want to restrict displaying Buttons in my applications based on the type of user logging in.
This seems to be for displaying sheet.
Also, I don't see a conditional display for the text box. So, how it is identifying which user is logging in?
I guess you are having two sheet one for admin and another for admin2.
You could use for this in the visibility-condition from the buttons:
if(osuser() = 'x', true()) or if(qvuser() = 'x', true())
If there are many users you could also extend these expressions with a pick(match()) or you checked only parts from the user-id with string-functions.
- Marcus
Hi
I've slightly changed my example. The Conditional Shows are available in several places, as described below;
Sheet > Sheet Properties > Show Sheet - Conditional
Text Objects > Properties > Layout Tab > Show - Conditional
Buttons> Properties > Layout Tab > Show - Conditional
To assign the users which button, you need to create an additional field. In my example, I have created SHEET. Therefore, should the users role be ADMIN sheet needs to be MS (or any other code you wish) and USER is SS (or again a code of your choosing).
These codes are used within the Profile Table (as Section Access fields cannot be used directly in your model as they are hidden). Thus we have "ThisRole" of 1 (for ADMIN) or 0 (for USER).
I have created two buttons, one for Role 1 ("ThisRole" = 1) and Role 0 ("ThisRole" = 0). For Role 0, Under the Layout tab for the button I have entered the formula 'ThisRole = 0' which means unless your Role is 0, you will not see the button.
Does that make sense? Let me know if you would like me to elaborate more or if this fixes it.
Steve
Ok, I got what you are saying.
For the section access below, I gave " if(QVUser()='ADMIN', true()) " in the both enable condition and in the layout condion for the button that I need to restrict. But when I logged in as "USER1", I am still able to see the buttion I added the condition.
Is there something I am missiong?
Section Access;
LOAD * INLINE [
ACCESS, USERID, PASSWORD
ADMIN, ADMIN, ADMIN
USER, USER1, USER1,
USER, USER2, USER2
];
Thanks,
Put qvuser() and osuser() in a textbox and you could see what qv returns and change your conditions - qvuser() returns only a value if section access with all required settings enabled and osuser() contains also the domain like domain\user.
- Marcus
HI
Did you look at my second qvw example? Is this what you are looking for? You set the variable in the section access code and then when you log on as either ADMIN or ADMIN2 (I've set Admin2 up as a user) with same password as username, you will see a button. If you log in as other user, you will see another button. These are separate buttons which are viewable depending upon the ThisRole field which is dependent upon the SHEET field in section access. The hide button calculation is under the layout tab of the buttons properties.
SImple enough yeah? Let me know of you need any more information.
Steve