Edgewall Software

Ticket #6766 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months 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:

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

Changed 10 months 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)),  

Changed 10 months ago by cboos

  • keywords permission added
  • milestone set to 0.11

Yes, it's that simple ;-)

Changed 10 months ago by osimons

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

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!

Changed 10 months ago by digiqr+trac@…

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

Add/Change #6766 (TitleIndex macro is not using Permissions)

Author



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