コード例 #1
0
ファイル: rest_facade.py プロジェクト: weizai118/ggrc-core
def create_user_with_role(role_name):
    """Create user a role `role_name`"""
    user = create_user()
    role = next(role for role in roles.global_roles()
                if role["name"] == role_name)
    rest_service.UserRolesService().create_obj(person=user.__dict__, role=role)
    user.system_wide_role = role["name"]
    return user
コード例 #2
0
def create_user_with_role(role_name):
  """Create user a role `role_name`"""
  user = create_user()
  role = next(role for role in roles.global_roles()
              if role["name"] == role_name)
  rest_service.UserRolesService().create_obj(person=user.__dict__, role=role)
  user.system_wide_role = role["name"]
  return user