If you call controller function and return something from this function, it will allways create new page (if you return string, it will be returned directly, if dictionary, it will be returned through the templating engine).
You can
1) test privileges before (when you create the page at first) and
a) immediately hide the button
--or-- b) have a hidden element <div style="display: none;">no privileges</div> and show it using javascript when user clicks
--or-- (if you don't want test privileges before, but after the click)
2) use ajax call (see ajax chapter of the book), which can return
a) script
--or-- b) innerHTML for some element
Dne čtvrtek 19. února 2015 9:15:09 UTC+1 Yebach napsal(a):