app/soc/views/helper/access.py
changeset 1555 cba45797f4b9
parent 1554 163c879d1ffe
child 1557 9e32e6258319
equal deleted inserted replaced
1554:163c879d1ffe 1555:cba45797f4b9
   685 
   685 
   686   def checkHasActiveRole(self, django_args, logic):
   686   def checkHasActiveRole(self, django_args, logic):
   687     """Checks that the user has the specified active role.
   687     """Checks that the user has the specified active role.
   688     """
   688     """
   689 
   689 
       
   690     django_args = django_args.copy()
   690     django_args['user'] = self.user
   691     django_args['user'] = self.user
   691     self._checkIsActive(django_args, logic, ['user'])
   692     self._checkIsActive(django_args, logic, ['user'])
   692 
   693 
   693   def _checkHasActiveRoleFor(self, django_args, logic, field_name):
   694   def _checkHasActiveRoleFor(self, django_args, logic, field_name):
   694     """Checks that the user has the specified active role.
   695     """Checks that the user has the specified active role.
   696     Only roles where the field as specified by field_name matches the
   697     Only roles where the field as specified by field_name matches the
   697     scope_path from the django_args are considered.
   698     scope_path from the django_args are considered.
   698     """
   699     """
   699 
   700 
   700     fields = [field_name, 'user']
   701     fields = [field_name, 'user']
       
   702     django_args = django_args.copy()
   701     django_args['user'] = self.user
   703     django_args['user'] = self.user
   702     self._checkIsActive(django_args, logic, fields)
   704     self._checkIsActive(django_args, logic, fields)
   703 
   705 
   704   def checkHasActiveRoleForKeyFieldsAsScope(self, django_args, logic):
   706   def checkHasActiveRoleForKeyFieldsAsScope(self, django_args, logic):
   705     """
   707     """