Edgewall Software
Modify

Ticket #6766 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

TitleIndex macro is not using Permissions

Reported by: digiqr+trac@… Owned by: cboos
Priority: normal Milestone: 0.11
Component: wiki system Version: 0.11b1
Severity: minor Keywords: permission
Cc:
Release Notes:
API Changes:

Description

I'm using TracFineGrainedPermissions, but [[TitleIndex]] macro is still showing all Wiki pages for everyone.
There could be option to hide that pages.

Attachments

Change History

comment:1 Changed 4 years ago by digiqr+trac@…

I don't know if this is correct and fast solution but it is working for me...

  • trac/wiki/macros.py

     
    102102            return tag.ul([tag.li(tag.a(wiki.format_page_name(page), 
    103103                                        href=formatter.href.wiki(page))) 
    104104                           for page in pages 
    105                            if depth < 0 or depth >= page.count('/') - start]) 
     105                           if (depth < 0 or depth >= page.count('/') - start) and 
     106                               'WIKI_VIEW' in formatter.perm('wiki', page)]) 
    106107         
    107108        # Group by Wiki word and/or Wiki hierarchy 
    108109        pages = [(self.SPLIT_RE.split(wiki.format_page_name(page, split=True)),  

comment:2 Changed 4 years ago by cboos

  • Keywords permission added
  • Milestone set to 0.11

Yes, it's that simple ;-)

comment:3 Changed 4 years ago by osimons

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

Fixed in [6472].

Moved the permission check further up to catch all use cases by dropping unauthorized pages when building the initial pagelist.

Tested, and worked fine - until I switched to date view and noticed that the RecentChanges macro had no interest in such permissions either. Now they both do.

Thanks for spotting and proposing a fix!

comment:4 Changed 4 years ago by digiqr+trac@…

Thanks for fix. I missed RecentChanges because we don't use it :)

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.