Is there a way to skip access rights for specific user?
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.
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)
lead_obj.unlink(cr, uid, lead_ids, context=context)
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
|Asked: 8/1/13, 3:21 AM|
|Seen: 875 times|
|Last updated: 12/16/15, 5:02 AM|