Skip to content

Role and Resource Management Implementation #17

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

Merged
merged 1 commit into from
Nov 23, 2024

Conversation

foyzulkarim
Copy link
Owner

@foyzulkarim foyzulkarim commented Nov 23, 2024

Changes Overview

This PR implements role-based access control (RBAC) functionality by adding two main components:

  1. Resource Management

    • New Resource domain for managing access control resources
    • Resources can be of type 'api', 'ui', or 'menu'
    • CRUD operations for resources with search and filtering capabilities
  2. Enhanced Role Management

    • Updated Role schema to support permission mapping
    • Added new endpoints for managing role permissions
    • Integrated role-resource relationship
    • Added role reference to User schema

Key Features

  • Resource creation and management with type categorization
  • Role permission management through new endpoints
  • Resource grouping by type functionality
  • Search and filtering capabilities for both roles and resources

Technical Details

  • Added new REST endpoints for resource management
  • Implemented permission mapping using MongoDB Map type
  • Added validation schemas for all new endpoints
  • Integrated with existing authorization middleware
  • Added proper error handling and logging

API Endpoints Added

  • GET /resources/search - Search resources
  • POST /resources - Create new resource
  • GET /roles/:id/permissions - Get role permissions
  • PUT /roles/:id/permissions - Update role permissions

Related Issues

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
40.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@foyzulkarim foyzulkarim changed the title feat(resource): implement resource management with CRUD operations an… Role and Resource Management Implementation Nov 23, 2024
@foyzulkarim foyzulkarim marked this pull request as ready for review November 23, 2024 10:48
@foyzulkarim foyzulkarim merged commit 95730d5 into main Nov 23, 2024
1 of 2 checks passed
@foyzulkarim foyzulkarim deleted the feature/rbac/resource-management branch December 1, 2024 00:19
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.

1 participant