relock permissions régionales
authorDavin Baragiotta <davin.baragiotta@auf.org>
Tue, 29 May 2012 20:48:27 +0000 (16:48 -0400)
committerDavin BARAGIOTTA <davin.baragiotta@auf.org>
Tue, 29 May 2012 20:48:27 +0000 (16:48 -0400)
project/rh/admin.py

index 9fd1a97..8b885c8 100644 (file)
@@ -127,6 +127,10 @@ class ProtectRegionMixin(object):
     def has_change_permission(self, request, obj=None):
         user_groups = request.user.groups.all()
 
+        # Lock pour autoriser uniquement les DRH à utiliser RH
+        if not in_drh_or_admin(request.user):
+            return False
+
         if len(user_groups) == 0 and not request.user.is_superuser:
             return False