lablup / lablup/backend.ai

List the permissions the current user holds

Open
#13,969 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

### Problem

A caller can read which roles are assigned to them (/v2/rbac/assignments/my/search) but not what those roles let them do. Reading the permission rows themselves is superadmin-only, so a non-admin frontend cannot decide what to show.

### Contract

A self-service read returning every permission carried by the roles mapped to the calling user. One item per permission row: scope (type and id), entity type, and the permission itself.

- REST v2: POST /v2/rbac/permissions/my/search, auth_required
- GraphQL: a my-prefixed root field; the adapter resolves the caller, the resolver passes no scope
- SDK: the rbac domain client
- CLI: ./bai my permission search

The caller is resolved in the adapter through current_user(), never taken as a request field.

JIRA Issue: BA-7485

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing /v2/rbac/assignments/my/search endpoint, then inspect the rbac domain client and the ./bai my permission search entry point. Check the GraphQL my-prefixed field and its adapter's current_user() resolution. Done means REST, GraphQL, SDK, and CLI expose each permission row with scope type and id, entity type, and permission without accepting a user field.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, python
Domain
api, authorization, backend, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.