• Resolved Blutarsky

    (@blutarsky)


    Hello, I have created a custom role named ‘User Manager’, which is used only to run REST API calls. Custom role allows creating users (it works) and should also update user roles (doesn’t work)

    User Manager granted rights:

    Read
    Create Roles	
    Create Users	
    Delete Roles	
    Delete Users	
    Edit Roles	
    Edit Users	
    List Roles	
    List Users	
    Promote Users	
    Remove Users
    ure_edit_roles
    

    When creating a user as for endpoint /wp/v2/users, WITHOUT specifying user role, the user creation will succeed, and user will be created with role ‘subscriber’.

    As soon as user creation will include the roles parameter, an error is thrown:

    http returned code: rest_user_invalid_role
    http returned text; Sorry, you are not allowed to give users that role
    status: 403

    The error seems to be fired here

    What permission are missing in your opinion?

    • This topic was modified 2 years, 1 month ago by Blutarsky.
    • This topic was modified 2 years, 1 month ago by Blutarsky.
Viewing 1 replies (of 1 total)
  • Thread Starter Blutarsky

    (@blutarsky)

    It looks like roles cannot be set on user creation! Can only be edited on existing user. We can close this

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot update user role through REST API (rest_user_invalid_role)’ is closed to new replies.