Modify

Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#10941 closed defect (fixed)

Change permission action definition for intuitive inheritance

Reported by: hasienda Owned by: hasienda
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 21 months ago by rjollos

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 21 months ago by hasienda

  • Owner changed from rjollos to hasienda

comment:3 Changed 21 months ago by hasienda

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:4 Changed 21 months ago by hasienda

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

Including more author comments and explicit license file for clarity.

comment:5 Changed 21 months ago by rjollos

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

comment:6 Changed 21 months ago by rjollos

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

Add Comment

Modify Ticket

Action
as closed The owner will remain hasienda.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.