Skip to Content

Contributors

Re: Define permissions in website (frontend)

Hello,

if the goal is to simply block login, you could override the login/authenticate method and raise a proper error.

If you want to block access to a specific route only, override it and raise proper exception when condition is not matched.

Bests,

On Wed, Sep 23, 2020 at 5:07 PM Yves Goldberg <yves@ygol.com> wrote:
Hello,

How would I grant access to a website but only for a res_partner fulfilling a condition?

user case is publishing a list that is only accessible to partners who have "condition = True".

Another option would be to have a public page protected by a single password. Maybe in a popup?

Is there a module that could help? any pointer?


I was thinking to get in the controller, the user's id from the session and then conditionally return the required data but maybe there is an easier way?




Thank you




 --
Yves Goldberg
odooOfficial Partner - OCA delegate
Open Source ERP, CRM & CMS
T +972 (3) 720 8818
+972 (55) 966 1405
+32 (2) 588 2500
 
 
--

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe



--
Simone Orsi

Full stack Python web developer, Odoo specialist, Odoo Community Board Member, Freelance in love with open source.

by Simone Orsi - 08:41 - 24 Sep 2020

Reference

  • Define permissions in website (frontend)
    Hello,

    How would I grant access to a website but only for a res_partner fulfilling a condition?

    user case is publishing a list that is only accessible to partners who have "condition = True".

    Another option would be to have a public page protected by a single password. Maybe in a popup?

    Is there a module that could help? any pointer?


    I was thinking to get in the controller, the user's id from the session and then conditionally return the required data but maybe there is an easier way?




    Thank you




     --
    Yves Goldberg
    odooOfficial Partner - OCA delegate
    Open Source ERP, CRM & CMS
    T +972 (3) 720 8818
    +972 (55) 966 1405
    +32 (2) 588 2500
     
     
    --


    by Yves Goldberg - 05:06 - 23 Sep 2020