Giter Club home page Giter Club logo

passpartu's People

Contributors

dmranderson avatar orestf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

passpartu's Issues

Add 'only' attribute

Add 'only' attribute to method 'can?'

Only accepts string, symbol or array of strings, or symbols

Feature: return false if use role is not listed in 'only' attribute
Example:
user.can?(:orders, :update, only: :manager)
AND
user.can?(:orders, :update, only: [:manager, :agent])

Waterfall rules - feature

Add configurable feature - waterfall_rules

If policy rule is missed, but the key above value equals true - positive policy (true)
It must work with any number of keys!

Example

admin:
  <<: *manager
  post:
    create: false
    update: true
    delete: true 
  order: true

admin_user.can?(:order, :create) # true
admin_user.can?(:order, :update) # true
admin_user.can?(:order, :whatever) # true

Deprecate CRUD key!

This deprecation is needed in order to migrate to editable policies. Second reason is - waterfall rules does this in a better way!

Add maybe!

Add maybe option to true and false.
Maybe means YES if block is NOT passed
Maybe means YES of block is provided AND is true

FIX: passpartu.yml - file path

In case if there are no passpartu.yml file in config folder - gem crashes, even if new path is configured as Passpartu.configure { |config| config. policy_file = './path/to_policy/file.rb' }

Expected - gem will not crash if ./config/passpartu.yml does not exist and another policy_file path is configured!

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.