Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating ShieldSeeder stub #290

Merged
merged 1 commit into from
Dec 19, 2023
Merged

Updating ShieldSeeder stub #290

merged 1 commit into from
Dec 19, 2023

Conversation

torosegon
Copy link
Contributor

@torosegon torosegon commented Dec 18, 2023

fix: Using current guard name in permission creation.

Copy link

what-the-diff bot commented Dec 18, 2023

PR Summary

  • Update ShieldSeeder.stub with better quality code
    This pull request provides several updates in the ShieldSeeder.stub file to enhance code quality and efficiency. The PermissionRegistrar has been imported from the Spatie\Permission namespace and its usage in the run() method has been simplified. This means that the system will now access permission registrar more efficiently.

  • Improvements on Roles and Permission models
    New import statements for role and permission models are added, making them interact effectively with Utils class. This means the system can now handle roles and permissions more accurately.

  • Optimized makeRolesWithPermissions() method
    The makeRolesWithPermissions() method underwent several optimizations, including the replacement of unnecessary collect and push calls with map() and all(). These changes significantly improve the system's performance when creating roles and permissions.

  • Flexible Guard Name Specification
    Hardcoded guard names 'web' in makeRolesWithPermissions() and makeDirectPermissions() methods have been replaced with more flexible guard names from role and permission models. This means the security of the application is now guaranteed since guard names can now adapt to different situations.

  • Enhanced makeDirectPermissions() method
    The makeDirectPermissions() method has been updated to use the imported permission model when creating direct permissions. This increases the effectiveness of creating direct permissions.

@bezhanSalleh bezhanSalleh merged commit f9abf08 into bezhanSalleh:3.x Dec 19, 2023
5 checks passed
@bezhanSalleh
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants