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

Skip User Access Rights

By
Sudhir Arya (SA)
on 8/1/13, 3:21 AM 864 views

Is there a way to skip access rights for specific user?

Scenario:

I am in a Multi Company environment and I have two companies Company AB that is a Main Company, Company A and Company B which are the child of Company AB.

Now user of Company A wants to access the records of Company B (In web client and by code). So how to access them or how to skip the access rights for specific user?

Is there a any way/trick to overcome from this by creating some record rules?

Suggestions are most welcome.

0

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 9/11/14, 5:02 AM

Hi..

Ya you can deceive the access rights for a user... using method "check_access_rights" which returns True if the user has access over an object... if it returns False, then you achieve the same by passing SUPERUSER_ID...

Example: In my case am trying to check whether user has delete permission for Crm.Lead... If he dont have am still proceeding with the action by passing SUPERUSER_ID...

              if not self.check_access_rights(cr, uid, 'unlink', raise_exception=False):
                                lead_obj.unlink(cr, SUPERUSER_ID, lead_ids, context=context)
              else:
                                lead_obj.unlink(cr, uid, lead_ids, context=context)

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

0 follower(s)

Stats

Asked: 8/1/13, 3:21 AM
Seen: 864 times
Last updated: 12/16/15, 5:02 AM