GithubHelp home page GithubHelp logo

Comments (4)

driesvints avatar driesvints commented on May 18, 2024

You can actually just use whatever you want. You choose the resource type. Whether that's singular or plural, that's totally up to you. 

Imo it makes more sense to use plural. Edit many posts with an optional identifier for a specific post. That's why I use that example in the docs.

Perhaps I should clarify better in the docs that you can use any string you want as a resource identifier?


Dries Vints

Lead Developer at BeatSwitch / beatswitch.com

Laravel.IO Manager / laravel.io

On Thu, Nov 27, 2014 at 12:28 PM, Franz Liedke [email protected]
wrote:

E.g. ->can('read', 'post', 8) instead of ->can('read', 'posts', 8).

Or is that just overkill?

Reply to this email directly or view it on GitHub:
#12

from lock.

franzliedke avatar franzliedke commented on May 18, 2024

What I meant was this: Both can('read', 'post', 8) and can('read', 'posts') should come down to the same resource called "posts".

from lock.

driesvints avatar driesvints commented on May 18, 2024

Hmm, I see what you mean. I'm not sure if I want to go there.

You see, a resource type is part of the contract you define when passing resources to the Acl instance. I'd rather just handle a specific one then "guess" which one I should pick based on the input. I think it's best that you just define the type one single type and stick to that. I honestly don't see the reasoning why you should ever want 2 types for 1 resource type.

from lock.

franzliedke avatar franzliedke commented on May 18, 2024

Yeah, it's not that important. Just thought this would make it even more readable. ;)

from lock.

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.