Add a projects field to User model. A list of Project
User model should contain the following fields:
username (required)
password (required)
name (required)
User controller should include the following methods:
create (ADMIN only)
update (ADMIN only. Regular users can update their name and password only.)
delete (ADMIN only)
list
show
Suggested tests:
- Create user using an
ADMIN user (should return 201 - Created)
- Create user using a user from any other level (should return 401 - Unauthorized)
- Update user using an
ADMIN user (should return 200 - OK)
- Update user using a user from any other level (should return 401 - Unauthorized)
- Regular user update other user (should return 401 - Unauthorized)
- Regular user update their name/password (should return 200 - OK)
- Regular user update other field but name/password (should return 401 - Unauthorized)
- Delete user using an
ADMIN user (should return 200 - OK)
- Delete user using a user from any other level (should return 401 - Unauthorized)
- List all user using an
ADMIN user (should return 200 - OK)
- List all user using a user from any other level (should return 200 - OK)
- View a user using an
ADMIN user (should return 200 - OK)
- View a user using a user from any other level (should return 200 - OK)
- Create/Update user without required fields
Add a
projectsfield toUsermodel. A list ofProjectUsermodel should contain the following fields:username(required)password(required)name(required)Usercontroller should include the following methods:create(ADMINonly)update(ADMINonly. Regular users can update their name and password only.)delete(ADMINonly)listshowSuggested tests:
ADMINuser (should return 201 - Created)ADMINuser (should return 200 - OK)ADMINuser (should return 200 - OK)ADMINuser (should return 200 - OK)ADMINuser (should return 200 - OK)