Edgewall Software

Ticket #3688 (closed defect: duplicate)

Opened 2 years ago

Last modified 22 months ago

BROWSER_VIEW, CHANGESET_VIEW, FILE_VIEW and LOG_VIEW don't appear as valid actions

Reported by: abarrei@… Owned by: cboos
Priority: high Milestone:
Component: admin/console Version: devel
Severity: normal Keywords:
Cc:

Description

When I tried to remove those permissions from the anonymous account, I get that they are invalid actions. trac-admin does not report them as actions:

Available actions:

CONFIG_VIEW, MILESTONE_ADMIN, MILESTONE_CREATE, MILESTONE_DELETE, MILESTONE_MODIFY, MILESTONE_VIEW, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE, REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW, SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY, WIKI_VIEW

The worst thing of this is that I can't take anonymous access to the source repository.

Attachments

Change History

  Changed 2 years ago by mgood

  • status changed from new to closed
  • resolution set to duplicate

You appear to have disabled the Trac components related to source code browsing, so those permissions have also been disabled. Since you've disabled those components no users will be ale to browse the repository, so that's not really an issue. See #2546 regarding the error removing disabled permissions.

follow-up: ↓ 3   Changed 2 years ago by abarrei@…

  • status changed from closed to reopened
  • resolution duplicate deleted

Sorry to reopen the ticket, just to let you know. I did enable the versioncontrol on the trac.ini and the actions are there now. The only thing that may be worth to mention is that the versioncontrol is automatically enabled if a repository path is configured but the actions are not available on that case, is that a normal behaviour?

Anyway, thank you for your reply.. I've seen trac some time ago but this is the first time I'll try it in a real development environment and the first impression was very very good,

Thanks, a.=

in reply to: ↑ 2   Changed 2 years ago by cboos

  • status changed from reopened to closed
  • resolution set to duplicate

Replying to abarrei@gmail.com:

... The only thing that may be worth to mention is that the versioncontrol is automatically enabled if a repository path is configured but the actions are not available on that case, is that a normal behaviour?

Sorry, couldn't reproduce that with latest trunk. I created a fresh environment, without setting repository_dir, and the above permissions were not listed, as expected. But as soon as the repository_dir value was set, the BrowserModule, ChangesetModule and LogModule were activated and their corresponding actions were added to the list...

So I'll close the ticket, but feel free to reopen once again if you can prove me wrong by providing a detailed recipe for reproducing the issue...

  Changed 23 months ago by Markus Tacker <m@…>

  • status changed from closed to reopened
  • version changed from 0.10b1 to devel
  • resolution duplicate deleted

I've created a new environment with r3945 and I encounter the same problem.

Available actions:
 CONFIG_VIEW, MILESTONE_ADMIN, MILESTONE_CREATE, MILESTONE_DELETE,
 MILESTONE_MODIFY, MILESTONE_VIEW, REPORT_ADMIN, REPORT_CREATE,
 REPORT_DELETE, REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN,
 ROADMAP_VIEW, SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP,
 TICKET_CREATE, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN,
 WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY, WIKI_VIEW
> permission list

User       Action
--------------------------
anonymous  BROWSER_VIEW
anonymous  CHANGESET_VIEW
anonymous  FILE_VIEW
anonymous  LOG_VIEW
> permission remove anonymous LOG_VIEW
Command failed: LOG_VIEW is not a valid action.

  Changed 23 months ago by cboos

  • owner changed from daniel to cboos
  • status changed from reopened to new
  • milestone set to 0.10.1

Right, now I can reproduce it with a repository where no repository_dir has been specified, and this also in 0.10-stable. I don't know why I missed it the first time, thanks!

  Changed 22 months ago by cboos

  • status changed from new to assigned

Well, the fix could be as simple as that:

  • trac/perm.py

     
    191191 
    192192    def revoke_permission(self, username, action): 
    193193        """Revokes the permission of the specified user to perform an action.""" 
    194         # TODO: Validate that this permission does in fact exist 
    195         if action.isupper() and action not in self.get_actions(): 
    196             raise TracError, '%s is not a valid action.' % action 
    197  
    198194        self.store.revoke_permission(username, action) 
    199195 
    200196    def get_actions(self): 

However, given the "TODO" comment in the above, I wonder what was the original intent of this code. Do I miss something, or couldn't we just proceed and delete any action, even those who are not known as valid any more , due to some disabled components?

  Changed 22 months ago by cboos

  • status changed from assigned to closed
  • resolution set to duplicate
  • milestone 0.10.3 deleted

Anyway, mgood just did that for fixing #2146, in r4360 ;)

Add/Change #3688 (BROWSER_VIEW, CHANGESET_VIEW, FILE_VIEW and LOG_VIEW don't appear as valid actions)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.