On Tuesday, June 5, 2018 at 7:34:38 AM UTC-4, Rahul wrote:
>
> Hi All,
>         I am visiting this group after a long time. I have a question 
> perhaps a simple one  - I want to check for user rights for my application 
> and I want to code it in plugin layout  (any_layout_installed.html ) file. 
> I am trying to verify parameters passed to this file. I can pass session 
> variables and check for the rights however one drawback is that if I change 
> the value from say True to False, it does not refresh this for the session 
> variable. I must restart the browser to get rid of this previously 
> initialized session variable. So I want to know if there is away to do this 
> with some local variables  (pass local variables) and if these could be 
> called in the view (*plugin_layouts\layouts\<any_plugin_layout.html>*)
>
> for example in layout view - 
> {{if user_right1==True:}}
>
>  <HTML CODE TO SHOW THE SECTION ELSE NOT >
> {{pass}}
>
>
>
> The question is where (in which function in the controller ) do I specify 
> this value *user_right1* to use it in 
> *plugin_layouts\layouts\<any_plugin_layout.html>* ?? I hope I am clear 
> with my question.
>

The variable user_right1 must either be defined in a model file or returned 
in the dictionary by the controller:

def myfunction():
    ...
    return dict(user_right1=True, ...)

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to