Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#10941 closed defect (fixed)

Change permission action definition for intuitive inheritance

Reported by: Steffen Hoffmann Owned by: Steffen Hoffmann
Priority: normal Component: VotePlugin
Severity: normal Keywords: permission
Cc: Trac Release:

Description

From description:

If a user has a valid session (created through the Preferences panel) and the VOTE_MODIFY permission, they will be able to vote.

This is not true, because he/she won't currently see the down-/up-vote links at all. Therefore more intuitive permission inheritance is suggested:

  • a/tracvote/__init__.py

    diff -u a/tracvote/__init__.py b/tracvote/__init__.py 
     
    117117
    118118    # IPermissionRequestor method
    119119    def get_permission_actions(self):
    120         return ['VOTE_VIEW', 'VOTE_MODIFY']
     120        action = 'VOTE_VIEW'
     121        return [('VOTE_MODIFY', [action]), action]
    121122
    122123    ### ITemplateProvider methods
    123124

For what its worth, if you assign someone VOTE_MODIFY, it does actually rely on seeing the vote links, doesn't it?

Attachments (0)

Change History (6)

comment:1 Changed 11 years ago by Ryan J Ollos

Yes, make sense. Thanks for catching that. Please feel free to commit.

Wiring up the unit tests has been on my TODO list for this plugin. For this change though, I don't imagine that a unit test is needed. A functional test would be nice, but better to get the fix in there and we'll add the functional test infrastructure when time allows.

comment:2 Changed 11 years ago by Steffen Hoffmann

Owner: changed from Ryan J Ollos to Steffen Hoffmann

comment:3 Changed 11 years ago by Steffen Hoffmann

Resolution: fixed
Status: newclosed

(In [12771]) TracVote: Allow for more intuitive permission setup by action inheritance, closes #10941.

comment:4 Changed 11 years ago by Steffen Hoffmann

(In [12775]) VotePlugin: Add an unit test harness, refs #10941.

Including more author comments and explicit license file for clarity.

comment:5 Changed 11 years ago by Ryan J Ollos

(In [12814]) Refs #10941: Added license header to setup.py.

comment:6 Changed 11 years ago by Ryan J Ollos

(In [12815]) Refs #10941: Replaced a single line containing tab-indentation with space-indentation.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
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.