Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Website page permission

By
Manu Miu
on 3/22/16, 6:05 AM 530 views

Hi,

how to set access permissions for web pages?

I want that only logged in users are allowed to see a specific page like myodooinstance.com/page/sample. And not only the page itself but also the menu entry (if possible).


Thanks!

2

Yenthe

--Yenthe--
6676
| 7 7 8
Turnhout, Belgium
--Yenthe--

My Odoo blog: http://www.odoo.yenthevg.com/

My Twitter: https://twitter.com/Yenthe666

Yenthe
On 3/22/16, 8:29 AM

Hi Manu,

This is by default handled by the controllers, which have an option to only allowed logged in users for example. In your case it would look like this:

class YourController(openerp.http.Controller): @route('/page/sample', auth='user') def your_function(self): return stuff()

 By default there are three types of controllers, with specific rights attached to them:

  • user: The user must be authenticated and the current request will perform using the rights of the user.

  • public: The user may or may not be authenticated. If she isn't, the current request will perform using the shared Public user.
  • none: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. There request code will not have any facilities to access the database nor have any configuration indicating the current database nor the current user

 For more information about controllers see this documentation: https://www.odoo.com/documentation/8.0/reference/http.html

Yenthe



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/22/16, 6:05 AM
Seen: 530 times
Last updated: 3/23/16, 6:23 PM