Closed
Description
Is this a possible security vulnerability?
- 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
- Create a principal.
- Create a principal role.
- Assign role to principal.
- 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