Comments (3)
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.
@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.
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)
- Class "Route" not found
- Class "App" Not Found
- Method App\\Nova\\Templates\\Formations::forceFill does not exist HOT 4
- Title will not save in templates HOT 5
- Using with Ebess\AdvancedNovaMediaLibrary
- use the laravel new lang folder path instead of the old one
- Compatibility with Laravel 11
- Page Resource Search does not work
- FR: Hide options from sidebar HOT 2
- Ability to hide nova-option HOT 1
- Detail view broken HOT 7
- Cast Date Field HOT 3
- PHP 8 Compatibility? -- Required parameter follows optional parameter HOT 2
- Remove template declaration in routes HOT 3
- Arabic encoding
- Nova 4 Support HOT 6
- TypeError: Cannot read properties of undefined (reading 'resource') HOT 3
- Error deleting a file HOT 1
- Call to undefined method Whitecube\NovaPage\Pages\Query::exists() HOT 3
- Can this be used for multiple page layouts? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nova-page.