Backend: create custom role endpoint
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- api, authorization, backend, databases
Research direction
Start with ADR #469 and the custom-roles model in #561, then trace the existing authorization endpoints and permission dependency handling. Implement the superuser-only POST endpoint with role validation, dependency closure, Casbin policy rows in the same transaction, and the audit event described in #587/#588. Done means success and each listed validation path have tests, including non-superuser rejection.
Written by the indexing model from the issue text.
Description
Implement the create custom role endpoint defined in the ADR (#469): create a user_defined role for a single resource type with a name, description and an initial permission set, persisted via the custom-roles model (#561) and rendered to Casbin p rows in the same transaction.
Superuser-only. Enforces: single resource type per role; name validation/uniqueness; permission ids valid for the resource type; dependency closure applied (a selected permission pulls in its required dependencies). Backs the create wizard (#571–#573).
Acceptance
POSTcreates a custom role with resource type + permissions;prows rendered in the same transaction.- Superuser-only; non-superuser rejected.
- Single-resource-type and name-uniqueness validation (400 on violation).
- Dependency closure enforced server-side (not only in the UI).
- Audit event recorded (see #587/#588); tests for success and each validation path.
- Dominant language
- Python
- Stars
- 0
- Forks
- 10
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openedx/openedx-authz
-
willow
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
openedx/openedx-authz#579 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
openedx/openedx-authz#593 ·
Maintainers usually reply within 1 day
-
willow
Difficulty 4/5 3-5 days Newbie friendliness 48/100
openedx/openedx-authz#590 ·
Maintainers usually reply within 1 day
-
willow
Difficulty 5/5 Over a week Newbie friendliness 35/100
openedx/openedx-authz#588 ·
Maintainers usually reply within 1 day
-
willow
Difficulty 5/5 Over a week Newbie friendliness 35/100
openedx/openedx-authz#587 ·
Maintainers usually reply within 1 day
All issues in openedx/openedx-authz
Similar issues
-
Server mode OAuth2: 'NoneType' object is not subscriptable on every request after re-submitting the OAuth2 login while already logged inPossibly taken @Rarasinhoo claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
pgadmin-org/pgadmin4#10733 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
aws-samples/sample-per-model-bedrock#752 ·
Maintainers usually reply within 1 day
-
lesson-submission pending-review
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Ikalus1988/MisakaNet#4452 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OCHA-DAP/topo-tools#250 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day