TomerHeber opened a new issue, #226:
URL: https://github.com/apache/polaris/issues/226

   ### Is this a possible security vulnerability?
   
   - [X] This is NOT a possible security vulnerability
   
   ### Describe the bug
   
   When I try to assign between a principal role and a principal I get 2xx.
   If I try to run the same assignment again (conflict) I will get 5xx.
   
   ### To Reproduce
   
   1. Create a principal.
   2. Create a principal role.
   3. Assign role to principal.
   4. Assign role to principal (again).
   
   ### Actual Behavior
   
   500 error.
   
   ```
   {
       "error": {
           "message": "Exception [EclipseLink-4002] (Eclipse Persistence 
Services - 4.0.3.v202405220658): 
org.eclipse.persistence.exceptions.DatabaseException\nInternal Exception: 
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique 
constraint \"grant_records_pkey\"\n  Detail: Key (granteecatalogid, 
privilegecode, granteeid, securableid, securablecatalogid)=(0, 4, 1599, 1149, 
0) already exists.\nError Code: 0\nCall: INSERT INTO GRANT_RECORDS 
(GRANTEECATALOGID, PRIVILEGECODE, GRANTEEID, SECURABLEID, SECURABLECATALOGID, 
VERSION) VALUES (?, ?, ?, ?, ?, ?)\n\tbind => [0, 4, 1599, 1149, 0, 1]\nQuery: 
InsertObjectQuery(org.apache.polaris.core.persistence.models.ModelGrantRecord@5780643b)",
           "type": "PersistenceException",
           "code": 500
       }
   }
   ```
   
   ### Expected Behavior
   
   409 - conflict.
   
   ### Additional context
   
   _No response_
   
   ### System information
   
   N/A


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to