Add a projects field to User model. A list of Project
Project model should contain the following fields:
name (required)
users (required)
description (optional)
Project controller should include the following methods:
create (ADMIN only)
update (ADMIN only)
delete (ADMIN only)
list (ADMIN only. Regular users can list projects which they are member of)
show (ADMIN only. Regular users can view projects which they are member of)
Suggested tests:
- Create project using an
ADMIN user (should return 201 - Created)
- Create project using a user from any other level (should return 401 - Unauthorized)
- Update project using an
ADMIN user (should return 200 - OK)
- Update project using a user from any other level (should return 401 - Unauthorized)
- Delete project using an
ADMIN user (should return 200 - OK)
- Delete project using a user from any other level (should return 401 - Unauthorized)
- List all projects using an
ADMIN user (should return 200 - OK)
- List all projects using a user from any other level (should return 200 - OK. all the projects listed should have the user as member)
- View a project using an
ADMIN user (should return 200 - OK)
- View a project using a user from any other level (should return "200 - OK" if the user is a member of the project, otherwise 401 - Unauthorized)
- Create/Update project without required fields
Add a
projectsfield toUsermodel. A list ofProjectProjectmodel should contain the following fields:name(required)users(required)description(optional)Projectcontroller should include the following methods:create(ADMINonly)update(ADMINonly)delete(ADMINonly)list(ADMINonly. Regular users can list projects which they are member of)show(ADMINonly. Regular users can view projects which they are member of)Suggested 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)