django-sitetree
django-sitetree copied to clipboard
Group permisions
Are any plans to set also the group permissions for a menu item? is more easy and reliable to make a menu item visible or not depending of the group
No plans for now, as access to a single item usually associated with one permission, but not a set described by a group. Meanwhile this kind of check could be achieved using item hook functionality.
with the hook functionality how i make a menu to been hidden on demand?
You define your tree item model with group ManyToManyField field. In your item hook just check every item group against current user group.
ok, but check against what? is no attribute like item.hidden to set the menu to hidden like item.hidden = True
ok, but check against what?
You need to define a custom item model. In it you're free to add any fields you like. E.g. you could have user_group ManyToManyField and check against it item.access_group == user.group
How do i define a costume menu item, in docs are not any examples for that
will be more easily if in the api exist a method or a flag that define is a specific menu item will be rended or not
There's a lot of APIs for that already. See http://django-sitetree.readthedocs.org/en/latest/models.html#models-customization