[trunk/v7] project_issue default access rule is wrong ?

Bug #1197308 reported by electro
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Low
OpenERP R&D Addons Team 1

Bug Description

Default access rule for project_issue module is
        <record model="ir.rule" id="issue_user_rule">
            <field name="name">Project/Issue: employees: public or employee or following or assigned</field>
            <field name="model_id" ref="model_project_issue"/>
            <field name="domain_force">['|',
                                            '|',
                                                ('project_id.privacy_visibility', 'in', ['public', 'employees']),
                                                '&amp;',
                                                    ('project_id.privacy_visibility', '=', 'followers'),
                                                    ('message_follower_ids', 'in', [user.id]),
                                            ('user_id', '=', user.id),
                                        ]</field>
            <field name="groups" eval="[(4,ref('base.group_user'))]"/>
        </record>

but I can't understand double '|'. I thing it should be:

     ['|',
          ('user_id', '=', user.id), '|',
          ('project_id.privacy_visibility', 'in', ['public', 'employees']),
          '&amp;',
              ('project_id.privacy_visibility', '=', 'followers'), ('message_follower_ids', 'in', [user.partner_id.id]),
     ]

With my rule module is working as expected

in addition, default access rule provided by portal_project_issue is same of mine so if you install this module too it will overwrite the default rule of project_issue addond and all will work fine.

regards

Tags: issue project
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

The first one domain syntax is correct, we can also use the '|','|' on the domain for multiple or condition.

Would you please explain which kind of problem you faced after using this record rule.

Thank you!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
electro (electro1) wrote :

sorry for my lack

using default rule a std user who is follower of a project can't see related issues and activities. Note that the related project has privacy=followers

This happens when the follower user is "user" for project module and "see own lead" in sales and nothing for all other modules.

Anyway after I've installed portal_project_issue the rule is changed automatically and the same user can see issues and activities for same project.. Without any changes, only installng the portal_prj_issue module.

This figure out some trouble with 1st or 2nd access rule, because installing a new module should change object visibility

I hope to be more clear now.

PS: where we can find docs about access rule syntax ?

Revision history for this message
electro (electro1) wrote :

Sorry I would say "...because installing a new module should NOT change object visibility..."

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello ,

On latest v7 I have seen the following domain for project issue with group Employee (base.group_user).

['|', ('user_id', '=', user.id), '|', ('project_id.privacy_visibility', 'in', ['public', 'portal', 'employees']), '&', ('project_id.privacy_visibility', '=', 'followers'), ('message_follower_ids', 'in', [user.partner_id.id]), ]

I have tested also this and its working as expected.

Thank you!

Changed in openobject-addons:
status: Incomplete → Invalid
Revision history for this message
electro (electro1) wrote :

Sorry Parik but the rule you saw in latest v7 is for portal_project_iusse that I said it's ok.

Problem is on project_issue. Provided rule in the head revision ( revision 9294) is not working

see: http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/project_issue/security/project_issue_security.xml

in addiction when portal_project_issue is installed above rule is replaced with one provided by the module.

that's why I cange status for this bug

Changed in openobject-addons:
status: Invalid → New
Amit Parik (amit-parik)
summary: - [v7] project_issue default access rule is wrong ?
+ [trunk/v7] project_issue default access rule is wrong ?
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

You are correct, My given record rule is under portal_project_issue module . We have override the same record rule on portal_project_issue. Same as the project issue.

When I installed the project_issue then is also installed the portal_project_issue, So no need to create rule on project_issue and override on portal_project_issue. We have to remove the rule of project_issue module.

Thank you!

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
electro (electro1) wrote :

Sorry again but why you have to remove the rule of project_issue module instead to fix it ?

may be I misunderstanding

regards

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

I already mention the reason of it. When we installed the project_issue then portal_project_issue is by default installed.

we have used the same record xml id under project issue and portal_project_issue means that we are override the rules, better we have to define it only one place that's why it has been removed from the project_issue module.

And rules of portal_project_issue is fine.

Thank you!

tags: added: issue project
removed: 7.0 access-rule project-issue
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.