file location: app/controllers/concerns/check_permission.rb
To set permissions edit permissions
method in the Module
Prefix Verb URI Pattern Controller#Action
v1_articles GET /v1/articles(.:format) v1/articles#index
POST /v1/articles(.:format) v1/articles#create
v1_article GET /v1/articles/:id(.:format) v1/articles#show
PATCH /v1/articles/:id(.:format) v1/articles#update
PUT /v1/articles/:id(.:format) v1/articles#update
DELETE /v1/articles/:id(.:format) v1/articles#destroy
v1_users GET /v1/users(.:format) v1/users#index
POST /v1/users(.:format) v1/users#create
v1_user GET /v1/users/:id(.:format) v1/users#show
PATCH /v1/users/:id(.:format) v1/users#update
PUT /v1/users/:id(.:format) v1/users#update
DELETE /v1/users/:id(.:format) v1/users#destroy
v1_authenticate POST /v1/authenticate(.:format) v1/authentication#authenticate
Table Articles {
String title;
Text body;
Integer user_id;
}
Table Users {
String name;
String email;
String password_digest;
}
Table Roles {
String name;
}
Table Assignments (join table) {
Integer user_id;
Integer role_id;
}
To seed databese by demo data - run bundle exce rake db:seed
- 11 users
- 3 roles (admin, reader, writer)
- 50 articles