code: def check_permission(cls, role, permission):
          
          result = permission in settings.ARCTIC_ROLES[role]
          # will try to call a method with the same name as the permission
          # to enable an object level permission check.
          if result:
              try:
                  return getattr(cls, permission)(role)
              except AttributeError:
                  pass
          return result
docs: Check if role contains permission