Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add property role to User #5

Open
OmalPerera opened this issue Mar 1, 2018 · 0 comments
Open

Add property role to User #5

OmalPerera opened this issue Mar 1, 2018 · 0 comments

Comments

@OmalPerera
Copy link
Member

There are three types of roles: user, admin and moderator. If the role is not set, it should default to user.

POST /users
Request schema 1

{
    "email": "[email protected]"
}

Response schema 1
Status 201: Return if the user was successfully created.

{
    "self": "http://localhost:8090/api/users/{user_id}",
    "email": "[email protected]",
    "role": "user"
}

Request schema 2

{
    "email": "[email protected]",
    "role": "moderator"
}

Response schema 2

{
    "self": "http://localhost:8090/api/users/{user_id}",
    "email": "[email protected]",
    "role": "moderator"
}

Status 400 Return if the input is invalid (e.g. invalid role name).

Note

  • Placeholder {user_id} should contain an actual value (eg.UUID, Integer, String...).
  • Role property can take either ‘user’, ‘moderator’, or the ‘admin’
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant