app/soc/views/helper/access.py
changeset 2178 1d27b489e7e4
parent 2171 83d96aadd228
child 2257 7c0af7e05257
equal deleted inserted replaced
2177:e2c193e1f631 2178:1d27b489e7e4
  1473       None if the current User has an active role (from manage_role_logic)
  1473       None if the current User has an active role (from manage_role_logic)
  1474            that belongs to the same scope as the role that needs to be managed
  1474            that belongs to the same scope as the role that needs to be managed
  1475     """
  1475     """
  1476 
  1476 
  1477     try:
  1477     try:
  1478       # check if it is my role the user's own role
  1478       # check if it is the user's own role
  1479       self.checkHasActiveRoleForScope(django_args, logic_for_role)
  1479       self.checkHasActiveRoleForScope(django_args, logic_for_role)
       
  1480       self.checkIsMyEntity(django_args, logic_for_role, 'user', True)
  1480       return
  1481       return
  1481     except out_of_band.Error:
  1482     except out_of_band.Error:
  1482       pass
  1483       pass
  1483 
  1484 
  1484     # apparently it's not the user's role so check 
  1485     # apparently it's not the user's role so check 
  1486     fields = {
  1487     fields = {
  1487         'link_id': django_args['link_id'],
  1488         'link_id': django_args['link_id'],
  1488         'scope_path': django_args['scope_path'],
  1489         'scope_path': django_args['scope_path'],
  1489         }
  1490         }
  1490 
  1491 
  1491     role_entity = role_logic.getFromKeyFieldsOr404(fields)
  1492     role_entity = logic_for_role.getFromKeyFieldsOr404(fields)
       
  1493 
  1492     if role_entity.status != 'active':
  1494     if role_entity.status != 'active':
  1493       raise out_of_band.AccessViolation(message_fmt=DEF_NO_ACTIVE_ROLE_MSG)
  1495       raise out_of_band.AccessViolation(message_fmt=DEF_NO_ACTIVE_ROLE_MSG)
  1494 
  1496 
  1495     fields = {
  1497     fields = {
  1496         'link_id': self.user.link_id,
  1498         'link_id': self.user.link_id,