Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#12583 closed defect (fixed)

Hide rule does not work when the user group has only the TICKET_VIEW permission

Reported by: federico.destefanis.work@… Owned by: Ryan J Ollos
Priority: normal Component: DynamicFieldsPlugin
Severity: normal Keywords: permissions
Cc: Trac Release: 0.11

Description

Do not know exactly if it is a defect, but "show_if_group" rule does not work as expected.

Users in groups with the TICKET_VIEW permission can still view all the fields. Only users in groups with the TICKET_MODIFY permission have fields hidden (correctly based on the rule).

my installation: trac 0.11rc1 with no other plugin than DynamicFieldsPlugin.

btw: thank you for this plugin.

Attachments (0)

Change History (8)

comment:1 Changed 10 years ago by Ryan J Ollos

I'll check the behavior with Trac 1.0, however Trac 0.11.x is no longer supported. Trac 0.11rc1 was released 8 years ago and I highly advise against running such an old version of Trac.

comment:2 Changed 10 years ago by Ryan J Ollos

Owner: changed from Rob Guttman to Ryan J Ollos
Status: newaccepted

Confirmed. The issue is that the rules are applied to input elements, and the ticket properties are hidden as a side-effect of applying the rules to input elements. When a user has TICKET_VIEW but not TICKET_MODIFY there are no input elements and the rules are skipped.

Last edited 10 years ago by Ryan J Ollos (previous) (diff)

comment:3 Changed 10 years ago by Ryan J Ollos

Should be fixed with the next commit, but the issue in #12575 is still causing problems during autopreview.

comment:4 Changed 10 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 15095:

2.2.0dev: Hide ticket props even when inputs are hidden

Fixes #12583.

comment:5 Changed 10 years ago by Ryan J Ollos

Keywords: 0.11 fields removed

Thanks again for the report. Note that you'll need to upgrade to Trac 0.12 or later, preferably to Trac 1.0.9 (the latest stable release), and install DynamicFieldsPlugin from dynamicfieldsplugin/trunk.

comment:6 Changed 10 years ago by federico.destefanis.work@…

Thank you rjollos for your time. I upgraded trac to 1.0.9 and now I'm testing the plugin. It works fine, but I think there is a little oversight at

source:dynamicfieldsplugin/trunk/dynfields/htdocs/rules.js@15096#L175

if (input.attr('id') !== undefined)

This breaks the hide rule when inputs are hidden.

I think it should be

if (input.attr('id') === undefined)

comment:7 Changed 10 years ago by Ryan J Ollos

Thanks, I'll take another look at the changes.

comment:8 Changed 10 years ago by Ryan J Ollos

In 15098:

2.2.0dev: Fixed inverted comparison from [15095]

Refs #12583.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.