Giter Site home page Giter Site logo

Comments (7)

hsluoyz avatar hsluoyz commented on May 22, 2024

@sujit-baniya plz use: https://casbin.org/docs/en/rbac-with-domains

It's not a gorm-adapter issue I think.

from gorm-adapter.

sujit-baniya avatar sujit-baniya commented on May 22, 2024

@hsluoyz Thanks for your response. I added the extra matcher parameter but still I don't see any effect. Need to check more.

[request_definition]
r = sub, dom, obj, act

[policy_definition]
p = sub, dom, obj, act

[role_definition]
g = _, _, _

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = g(r.sub, p.sub, r.dom) && r.dom == p.dom && r.obj == p.obj && r.act == p.act || r.sub == root

from gorm-adapter.

hsluoyz avatar hsluoyz commented on May 22, 2024

@sujit-baniya see: https://casbin.org/docs/en/rbac#use-pattern-matching-in-rbac

from gorm-adapter.

sujit-baniya avatar sujit-baniya commented on May 22, 2024

@hsluoyz Thanks again :). I tried and now I could get all Domains associated with the Admin account using following Model.

[request_definition]
r = sub, dom, obj, act

[policy_definition]
p = sub, dom, obj, act

[role_definition]
g = _, _, _

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = g(r.sub, p.sub, r.dom) && keyMatch2(r.dom, p.dom) && r.obj == p.obj && r.act == p.act

Still casbin is not providing any API for getting all users for a Domain. Creating one issue on Casbin.

from gorm-adapter.

sujit-baniya avatar sujit-baniya commented on May 22, 2024

@hsluoyz Here, casbin/casbin#782

from gorm-adapter.

sujit-baniya avatar sujit-baniya commented on May 22, 2024

Also can you please suggest which storage would be best for high performance: CSV vs POstgres

from gorm-adapter.

hsluoyz avatar hsluoyz commented on May 22, 2024

@sujit-baniya DB adapter is better for production use.

Closed here.

from gorm-adapter.

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.