how do restrict user to view diffrent user information?

Asked by shanky

Hello,

Before to post my question, I got same question which is my same requirement
https://answers.launchpad.net/openobject-addons/+question/107828

I read all detail, but do not understand I need brief description.
and any example for define a Record rules for restrict the data by user.
Regards
  Shankar

Question information

Language:
English Edit question
Status:
Expired
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#1

Hello Shanker,

Check the following link for understanding record rules and access rights:

http://doc.openerp.com/book/8/8_20_Config/8_20_Config_accessRights.html

Hope this will help you.

Thanks.

Revision history for this message
shanky (shankar-shinde-deactivatedaccount) said :
#2

Hello vra,
I try with given reference link, I don't get how to do it.
Is there any tutorial example?
Thanks,
  Shankar

Revision history for this message
shanky (shankar-shinde-deactivatedaccount) said :
#3

Hello vra,
More explanation :

I want to achieve below requirement, but I am stuck in it.

My requirement :

Suppose I have Project1. Project1 has member(customer1,manager1,team
members1).
Similar to Project1 I have another project, Project2.
Project2 has member(customer2,manager2,team members2).

I have put them all in group like project manager. And as they are in
same group, they can see each others project detials.
Now, I want to restrict them to view detials of each others project.

How do I achieve this feature? Please guide me.
Regards
  Shankar

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#4

Hello Shanker,

You need to put 'Project1' and 'Project2' inside Project Manager group and Their member are consider as 'Project / User'.

Hope this will help you.

Thanks.

Revision history for this message
shanky (shankar-shinde-deactivatedaccount) said :
#5

Hello vra,

According to your suggestion I can put project member in Project / User group.

But for 'Project1' and 'Project2' this is record(data) like (python project,Open ERP project,Postgres Project etc) defined on 'project.project' object, This 'project.project' object we can give permission(write,read,create,delete)

"access_project_project_manager","project.project manager","model_project_project","project.group_project_manager",1,1,1,1

I do not get how to put 'Project1' and 'Project2' in the Project/Manager group

Shankar

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) said :
#6

Hello Shanker,

You can modify the group (Using Administration/Users/Groups Menu.)and add the access rights for different object what you want.You need to simple insert the access rights in 'Access Rights' tab (One2many field).

Thanks

Revision history for this message
Anup(SerpentCS) (anup-serpent) said :
#7

Hello Shankar,

   you can use the domains in the view of project so that others user will not be able to see the projects of other users.
   for example
  domain="[('project_id.user_id','=',uid)]" in project_view.xml

 Hope this will help you.

Thanks.

Revision history for this message
openT (useruser) said :
#8

Hey shanky,

I'm not exactly sure what you're trying to restrict, but if I'm right you're trying to restrict the view of the users of project 1 to see only their project (managers, team members, customers, etc.) and the same concept with the users of project 2.

First of all, make sure you have the members you want in each according projects then ;

- From the left side panel, go in Administration/Security/Record Rules

- Click the button to create a new record rule

- For "object", click on the search button and you can type "project" in object search field in order to show only the objects of a Project. When they are filtered, choose "Name : Project ---- Object : project.project"

- Afterwards, choose a relevant name so that you can easily pick the record rule in the future

- Now for the restriction! click on the right button (when you hover on it the phrase "save parent record" appears), then click again on the same spot (should show "Create new record" now).

- A menu will pop up,
in the field case, choose "Project -- members -- Project Members"
in the operator case choose "="
in the operand case choose "User/Name"

I tried this out and it seems to work; it only shows the project a member is in.

You can also make the record-rule "NON-global" and add it to the according groups (Project/Manager) and (Project/User) in their "Rules" tab.

Hope this helped! thanks

Revision history for this message
shanky (shankar-shinde-deactivatedaccount) said :
#9

Hey openT and Anup

Thanks for answer

Due to both of your answer I solved two different problem

Thanks lots again
Shankar

Revision history for this message
shanky (shankar-shinde-deactivatedaccount) said :
#10

Thanks openT, that solved my question.

Revision history for this message
shanky (shankar-shinde-deactivatedaccount) said :
#11

Hello,
I reopen this issue,
my query is :
I create New Task for some Project (x),
Now I entered some text in 'Task Summary' text-box and select Project (x) from Project window
I want to select only project members ( not all present in res.users) to this current task. So when I click on search option I want to display only project members in search list. So that I would able to select only from project members in list.

For this I tried following code also:

1) 'user_id': fields.many2one('res.users', 'Assigned to',domain="[('id','in',['7','8','11'])]" ),
where (7,8,11) are users ID for testing It shows correct result

'user_id': fields.many2one('res.users', 'Assigned to',domain="[('id','in',[project.members.uid])]" ), But it won't work
So please help me.

Revision history for this message
Launchpad Janitor (janitor) said :
#12

This question was expired because it remained in the 'Open' state without activity for the last 15 days.