idlesign/django-sitetree

dynamic sitetree - access_by_perms

waszi opened this issue · 3 comments

waszi commented

I have tried to add access_by_perms to my dynamic sitetree but it is ignored. Test user wihout
'service.is_hosting_user' is still able to see menu item.

my app sitetrees.py:

from sitetree.utils import tree, item
from django.utils.translation import ugettext_lazy as _

sitetrees = (
    tree('dynamic', items=[
        item(
            _('FTP Accounts'),
            'ftp:index',
            access_loggedin=True,
            access_by_perms=['service.is_hosting_user'],
            alias='ftp_index',
            children=[
                item(_('Add'), 'ftp:add'),
                item(_('List'), 'ftp:index'),
                item(_('{{ obj }}'), 'ftp:edit obj.pk', in_menu=False, children=[
                    item('Access logs', 'ftp:logs obj.pk'),
                ]),
            ]
        ),
    ]),
)

Thank you for the report.
I'll try to reproduce it and see what could be done in a couple of days.

You can now verify changes in bugfix/165 fixed the problem - 4fef97f

Consided closed by b658509