GithubHelp home page GithubHelp logo

Best practice about pycasbin HOT 3 CLOSED

casbin avatar casbin commented on May 18, 2024 1
Best practice

from pycasbin.

Comments (3)

hsluoyz avatar hsluoyz commented on May 18, 2024 1

@techoner @Xhy-5000 please provide some advices.

from pycasbin.

Xhy-5000 avatar Xhy-5000 commented on May 18, 2024 1

v0 - v5 means value 0 to value 5, each value can be one of Subject/Object/Action in the policy rule.
In PML's grammar, it is: p = sub, obj, act
policy rule ::= {value1, value2, value3, ...}
e.g. {alice, data1, read} => p.sub = alice, p.obj = data1, p.act = read
The adapters add some more value variables for longer policy rules, you can just ignore it if your policy rules are shorter than 6 values.:)

from pycasbin.

hsluoyz avatar hsluoyz commented on May 18, 2024

Example 1

  • Yes, use get_implicit_permissions_for_user()

As another example; if I wanted to use DB table ID's instead of Store names, would I use the table name as a domain?

It's not good. Domain is a logic concept than an object like table. You can use global ID to remove duplication between tables.

from pycasbin.

Related Issues (20)

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.