Skip to content

feature/API-70/adjust-role-guards-permission#108

Merged
andres15alvarez merged 1 commit intodevfrom
feature/API-70/adjust-role-guards-permission
May 17, 2025
Merged

feature/API-70/adjust-role-guards-permission#108
andres15alvarez merged 1 commit intodevfrom
feature/API-70/adjust-role-guards-permission

Conversation

@andres15alvarez
Copy link
Member

This pull request introduces several changes to enhance role-based access control, improve functionality for branch-specific operations, and refactor the codebase for better modularity and maintainability. The most significant updates include expanding UserRole.BRANCH_ADMIN permissions, adding branch-specific logic to inventory and order operations, and refactoring the order-related services into separate modules.

Role-based Access Control Enhancements:

  • Updated @Roles decorators in CouponController, PromoController, and OrderController to include UserRole.BRANCH_ADMIN, granting branch administrators access to create, update, delete, and manage coupons, promos, and orders. [1] [2] [3] [4]

Branch-specific Logic:

  • Added branch-specific validation in InventoryController to ensure that branch administrators can only create, update, or delete inventory items for their assigned branch. [1] [2] [3]
  • Updated OrderController to restrict branch administrators to managing orders within their branch and added branch ID handling for bulk updates and status changes. [1] [2]

Service Refactoring:

  • Refactored the order-related services by splitting OrderService into OrderService and OrderDeliveryService, improving separation of concerns and modularity. Updated relevant imports and constructors in controllers and gateways. [1] [2] [3] [4] [5]

Codebase Simplification:

  • Removed the EmailController test file, likely due to redundancy or deprecation.
  • Enhanced InventoryService methods to include branch-specific filtering for update and remove operations, ensuring data integrity across branches.

These changes collectively improve the system's security, maintainability, and scalability by enforcing stricter role-based access and modularizing key functionalities.

@andres15alvarez andres15alvarez self-assigned this May 17, 2025
@andres15alvarez andres15alvarez added the feature New feature or request label May 17, 2025
@andres15alvarez andres15alvarez merged commit 629b646 into dev May 17, 2025
2 checks passed
@andres15alvarez andres15alvarez deleted the feature/API-70/adjust-role-guards-permission branch May 17, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant