Giter Site home page Giter Site logo

Authorization about nova-page HOT 3 CLOSED

whitecube avatar whitecube commented on September 15, 2024
Authorization

from nova-page.

Comments (3)

toonvandenbos avatar toonvandenbos commented on September 15, 2024

Hi @zippoxer,

For the moment, we didn't work much on authorization & policies within this package.

We do automatically include an Authorize middleware for the internal API calls, however we did not configure a canSee callback on the Tool, meaning the authorization will always pass. You could include your own authorization rules during the tool's registration, hope this helps.

I'm not sure if there is more we could do. If you have a better idea, and you're willing to take a look at this issue, feel free to submit a PR. We'll be glad to help, ask your questions here or on the PR's thread.

from nova-page.

zippoxer avatar zippoxer commented on September 15, 2024

@Nyratas

Thanks. In the meantime, this works for me in NovaServiceProvider.php:

    /**
     * Get the tools that should be listed in the Nova sidebar.
     *
     * @return array
     */
    public function tools()
    {
        return [
            \Whitecube\NovaPage\NovaPageTool::make()->canSee(function ($request) {
                return $request->user()->isAdmin();
            }),
        ];
    }

from nova-page.

toonvandenbos avatar toonvandenbos commented on September 15, 2024

Great to hear!

I'm closing this issue now, I don't think we'll add more authorization capabilities soon. However, feel free to suggest changes.

from nova-page.

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.