Code Monkey home page Code Monkey logo

exercise's Introduction

README

CheckPermission Module

file location: app/controllers/concerns/check_permission.rb

Set permissions

To set permissions edit permissions method in the Module

API routes

                 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

Database structure

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;
}

Database seeding

To seed databese by demo data - run bundle exce rake db:seed

  • 11 users
  • 3 roles (admin, reader, writer)
  • 50 articles

exercise's People

Contributors

kievbuy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.