Skip to content

Could not add user to "admins" group #822

@amachekhin

Description

@amachekhin

Describe the bug
I want to add new user to admins user group via REST API v2, but PATCH request fails with 400 code FIELD_INVALID_CHOICE

To Reproduce
Steps to reproduce the behavior:

curl -X 'PATCH' \
  'https://10.1.20.200/api/v2/user/group' \
  -H 'accept: application/json' \
  -H 'x-api-key: XXXXXXXXXXXX' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": 1,
  "name": "admins",
  "scope": "system",
  "description": "System Administrators",
  "member": [
    "admin", "baz"
  ],
  "priv": [
    "page-all"
  ]
}'

Expected behavior
User baz should be added to the group admins

Screenshots or Response

{
  "code": 400,
  "status": "bad request",
  "response_id": "FIELD_INVALID_CHOICE",
  "message": "Field `scope` must be one of [local, remote]",
  "data": []
}

pfSense Version & Package Version:

  • pfSense Version: [e.g. pfSense 2.8.1]
  • Package Version [e.g. v2.6.2]

Affected Endpoints:

  • URL: [e.g. /api/v2/user/group]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIssues or PRs that enhance existing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions