Skip to content

Add and enforce shipping:manage permission#2408

Merged
alecritson merged 4 commits intolunarphp:1.xfrom
ryanmitchell:fix/shipping-permissions
Feb 17, 2026
Merged

Add and enforce shipping:manage permission#2408
alecritson merged 4 commits intolunarphp:1.xfrom
ryanmitchell:fix/shipping-permissions

Conversation

@ryanmitchell
Copy link
Contributor

At the moment there is no enforcement of a permission for the table rate shipping resources in the panel, this PR adds that.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds permission enforcement to the table rate shipping resources in the Lunar admin panel by introducing a shipping:manage permission. Previously, these resources had no permission checks, which meant they were accessible to all authenticated users regardless of their assigned permissions.

Changes:

  • Added shipping:manage permission property to three shipping-related Filament resources
  • Created a migration to register the new permission in the database

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/table-rate-shipping/src/Filament/Resources/ShippingZoneResource.php Added $permission property to enforce shipping:manage permission
packages/table-rate-shipping/src/Filament/Resources/ShippingMethodResource.php Added $permission property to enforce shipping:manage permission
packages/table-rate-shipping/src/Filament/Resources/ShippingExclusionListResource.php Added $permission property to enforce shipping:manage permission
packages/table-rate-shipping/database/migrations/2026_02_16_100000_add_can_manage_permission.php Migration to create the shipping:manage permission with proper guard handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

use Lunar\Base\Migration;
use Spatie\Permission\Models\Permission;

class AddCanManagePermission extends Migration
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use anonymous classes so it's consistent across the package :)

return new class extends Migration
{

@alecritson
Copy link
Collaborator

Thanks @ryanmitchell only a couple of small bits, the other being the name of the migration.

2026_02_16_100000_add_can_manage_permission.php

Can this be something like _add_can_manage_shipping_permission so it's clear what the intent is.

@ryanmitchell
Copy link
Contributor Author

@alecritson both changes made

@alecritson alecritson merged commit c9d773e into lunarphp:1.x Feb 17, 2026
44 of 45 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants