serenysoft / nova-permissions

Laravel Nova 4 Roles & Permissions
72 stars 25 forks source link

Add Role and Permission Policy Methods to NovaPermissions #49

Closed HenriqueSPin closed 2 months ago

HenriqueSPin commented 2 months ago

This pull request introduces two new methods to the NovaPermissions class: rolePolicy and permissionPolicy and adds eager loading of permissions relationship on the Role resource.

These additions provide more flexibility in defining custom role and permission policies within the NovaPermissions package and improve the performance of the Role resource index page.

Please review the changes and let me know if there are any issues or suggestions for further improvements. Thank you!

HenriqueSPin commented 2 months ago

@leandrogehlen Can you take a look, please?

Ou: Pode dar uma olhada, irmão?! :)

leandrogehlen commented 2 months ago

Hello @HenriqueSPin. I'm sorry for the delay.

Please add changelog entry (1.6.2)

HenriqueSPin commented 2 months ago

Done @leandrogehlen

leandrogehlen commented 2 months ago

The cache permissions relation issues should be another PR.

I'm not sure but laravel-permission uses cache by default

https://spatie.be/docs/laravel-permission/v6/advanced-usage/cache

HenriqueSPin commented 2 months ago

This is a

The cache permissions relation issues should be another PR.

I'm not sure but laravel-permission uses cache by default

https://spatie.be/docs/laravel-permission/v6/advanced-usage/cache

This is not related to the cache from the Spatie package. This is to avoid the query in Role::loadPermissions() to run on every line on an index page.

leandrogehlen commented 2 months ago

Please, remove permissions relation issues from this PR.

I'm not sure about this implementation.

I belive that should be use cache functionality for it.

HenriqueSPin commented 2 months ago

Done. Removed performance related tweaks.

HenriqueSPin commented 2 months ago

@leandrogehlen You forgot to create the tag 1.6.2.

leandrogehlen commented 2 months ago

No, i'm waiting #50, to release the version.