Hi
I have a canvas page with many command buttons.
May I know how can I use Lianja security to control user access to certain command buttons on my Canvas page?
Your assistance is much appreciated
Thanks & Best Regards
Hi
I have a canvas page with many command buttons.
May I know how can I use Lianja security to control user access to certain command buttons on my Canvas page?
Your assistance is much appreciated
Thanks & Best Regards
Hi Tek Hong,
You can use the UI presentation rules to "hide" or "disable" command buttons based on the UI presentation rules for "Visible when" and "Enabled when". These only take effect when you switch into runtime App view.
Principal developer of Lianja, Recital and other products
Follow me on:
Twitter: http://twitter.com/lianjaInc
Facebook: http://www.facebook.com/LianjaInc
LinkedIn: http://www.linkedin.com/in/barrymavin
Hi Tek
In VisibleWhen you can use functions explained here:
The roles are all in the system!sysroles table (thats what the "Users" workspace works on). You can do what you want with this table at runtime. Passwords use the built-in md5() function to encrypt them.
The userName() function returns the name of the logged in user.
The userEmail() function returns the email address for the logged in user.
The userRoles("username") function returns a comma separated list of roles applicable for a given user.
The userDomain("username") function returns the "domain/tenancy" for that user.
UI states can be used to hide/show UI elements based on the "roles" that a certain user has. Changing the "state" of the UI can set filters on sections. You create states using the UI state editor and change states using either the Lianja system object Lianja.changeState("name_of_the_state") or an inline delegate $("changestate:name_of_the_state"). The UI states editor has the ability to set multiple attributes for a given state. Why is the UI state machine important? Answer, because you don't have to hard code filters or anything like that into the App and you can modify "states" in one place.
Also, take a look here:
http://www.lianja.com/documentation/...nd-permissions
Hi Josip
Thanks for your response. I also have a need to hide certain command buttons in my custom sections
May I know what property I must set to dynamically hide code based command buttons in my custom section?
Your advice is much appreciated
Thanks & Best Regards
Hi Tek,
You can use other function but lets say role is the best choice. You need to add new user with a role. E.g. user "n1" in role "r1".
Be aware that you have to deploy user table too when you prepare your final installation.
Now add 2 commandbuttons, first one with attribute VisibleWhen using function. Or some other logic.
Log out and log in as users with and without role r1, to see it in action.
Only second commandbutton is shown if you are not logged as user who is in role r1.
Hi Josip
In my case, my commandbutton is created using code in custom section
May I know what property I should set using code as I do not have an attributes panel for commanbutton created in code?
Your kind assistance is much appreciated
Thanks & Best Regards
Hi Tekhong,
Try this.
In the top of your custom section, public the variable you are going to use for the button - under where it says namespace.
For example.
/
// Lianja custom section for page "page1" section "section2"
//
namespace gap
public tekbutton1
define class page1_section2 as section
.......
.......
Then anywhere in the code, you can just use
tekbutton1.hide
Herb
and of course to show it, you use tekbutton1.show.
Herb
Hi Herb
Is there a property of commandbutton that allow me to specify the visibility expression?
I checked the documentation and find only a "Visible" property which must be a boolean
Your advice is much appreciated
Thanks & best Regards
Tek,
It is the same thing.
tekbutton1.hide is the same thing as tekbutton1.visible = .f.
tekbutton1.show is the same thing as tekbutton1.visible = .t.
All of these will work.
Herb
Bookmarks