You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_4 (already cloned)
- Base commit: bca8979a0cd25472b2f9b5e9d9daf7509a7b3cbb
- Task ID: juspay__hyperswitch-7878
- Version: v1.113.0
TASK DESCRIPTION: Bug: Add support to create profile level custom role
Closes issue : https://github.com/juspay/hyperswitch/issues/7740
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
This pr will enable profile level custom creation from API and also enable org level custom role read
Additional Changes
- This PR modifies the API contract
- This PR modifies the database schema
- This PR modifies application configuration/environment variables
Motivation and Context
How did you test it?
1 . Valid operation Request :
curl --location 'http://localhost:8080/user/role' \ --header 'authorization: Bearer JWT' \ --header 'cookie: login_token=JWT' \ --data '{ "role_scope": "profile", "entity_type": "profile", "groups": [ "operations_view", "operations_manage" ], "role_name": "profile-role-at-profile-scope" }'Response
{ "role_id": "role_vcPMQVtjv0jblNi1tOxB", "groups": [ "operations_view", "operations_manage" ], "role_name": "profile-role-at-profile-scope", "role_scope": "profile", "entity_type": "profile" }- Invalid operation Request
Assistant
I'll help you implement the feature to add support for creating profile-level custom roles in the hyperswitch repository. Let me start by examining the repository structure and understanding the current role management implementation.
First, let me create a plan of action based on the requirements:
Assistant
Let me first explore the repository structure to understand where role-related code might be located:
Assistant
(no content)
Assistant
Now let me look at the specific files related to role creation and the API endpoint mentioned in the issue:
Assistant
Let me examine the role creation API endpoint and the associated models:
Assistant
Let me now examine the API models for role creation:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.