Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group permisions #193

Open
SoulRaven opened this issue Feb 7, 2016 · 7 comments
Open

Group permisions #193

SoulRaven opened this issue Feb 7, 2016 · 7 comments
Labels

Comments

@SoulRaven
Copy link

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

@idlesign
Copy link
Owner

idlesign commented Feb 8, 2016

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.

@SoulRaven
Copy link
Author

with the hook functionality how i make a menu to been hidden on demand?

@idlesign
Copy link
Owner

You define your tree item model with group ManyToManyField field.
In your item hook just check every item group against current user group.

@SoulRaven
Copy link
Author

ok, but check against what? is no attribute like item.hidden
to set the menu to hidden
like item.hidden = True

@idlesign
Copy link
Owner

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

@SoulRaven
Copy link
Author

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

@idlesign
Copy link
Owner

There's a lot of APIs for that already.
See http://django-sitetree.readthedocs.org/en/latest/models.html#models-customization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants