Permalink
Browse files

adds permission check for autocomplete view

  • Loading branch information...
1 parent d99c101 commit 1ea405f1d0e8da25ddb8accaea0380c83ec61bfb @stefanfoulis stefanfoulis committed Dec 10, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 stacks/fields.py
View
@@ -6,3 +6,9 @@
class StackSearchField(AutoModelSelect2Field):
search_fields = ('name__icontains', 'code__icontains',)
queryset = Stack.objects
+
+ def security_check(self, request, *args, **kwargs):
+ user = request.user
+ if user and not user.is_anonymous() and user.has_perm('djangocms_stack.change_stack'):
+ return True
+ return False

0 comments on commit 1ea405f

Please sign in to comment.