Align RBAC API contract
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
8dc61d7786
commit
4c4d037a1e
39 files changed
+410
-1071
No files matched your search
+14
-22
@@ -202,6 +202,13 @@ export default function ProfilePage() {
|
||||
<span className="text-sm text-muted-foreground">—</span>
|
||||
)}
|
||||
</InfoRow>
|
||||
{user.role && <InfoRow label={t("roles.fields.scope", "Scope")} value={user.role.scope} />}
|
||||
{user.role && (
|
||||
<InfoRow
|
||||
label={t("roles.fields.isSuper", "Super role")}
|
||||
value={user.role.isSuper ? t("common.yes", "Hawa") : t("common.no", "Ýok")}
|
||||
/>
|
||||
)}
|
||||
|
||||
<InfoRow label={t("users.sections.branches", "Şahamçalar")}>
|
||||
{branches.length > 0 ? (
|
||||
@@ -236,23 +243,12 @@ export default function ProfilePage() {
|
||||
<InfoRow label={t("users.sections.permissions", "Rugsatlar")}>
|
||||
{permissions.length > 0 ? (
|
||||
<div className="flex flex-wrap gap-1.5">
|
||||
{permissions.map((p) =>
|
||||
isAdmin ? (
|
||||
<Link
|
||||
key={p.id}
|
||||
to={`/settings/users/permissions/${p.id}`}
|
||||
className="inline-flex items-center gap-1 text-xs border border-border rounded-md px-2 py-1 hover:bg-muted transition-colors"
|
||||
>
|
||||
<KeyRound size={11} className="text-muted-foreground" />
|
||||
<span className="text-foreground font-medium">{p.name || p.code || p.id}</span>
|
||||
</Link>
|
||||
) : (
|
||||
<span key={p.id} className="inline-flex items-center gap-1 text-xs border border-border rounded-md px-2 py-1">
|
||||
<KeyRound size={11} className="text-muted-foreground" />
|
||||
<span className="text-foreground font-medium">{p.name || p.code || p.id}</span>
|
||||
</span>
|
||||
),
|
||||
)}
|
||||
{permissions.map((permission) => (
|
||||
<span key={permission.code} className="inline-flex items-center gap-1 text-xs border border-border rounded-md px-2 py-1">
|
||||
<KeyRound size={11} className="text-muted-foreground" />
|
||||
<span className="text-foreground font-medium">{permission.name || permission.code}</span>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<span className="text-sm text-muted-foreground">—</span>
|
||||
@@ -267,10 +263,6 @@ export default function ProfilePage() {
|
||||
<Shield size={14} />
|
||||
{t("profile.actions.assignRole", "Rol birikdiriň")}
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" className="gap-1.5" onClick={() => setAssignDialog("permission")}>
|
||||
<KeyRound size={14} />
|
||||
{t("profile.actions.assignPermissionRole", "Rola rugsat birikdiriň")}
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" className="gap-1.5" onClick={() => setAssignDialog("branch")}>
|
||||
<Building2 size={14} />
|
||||
{t("profile.actions.assignBranch", "Şahamça birikdiriň")}
|
||||
@@ -340,7 +332,7 @@ export default function ProfilePage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* ── Assign dialog (role/permission/branch) ─────────────── */}
|
||||
{/* ── Assign dialog (role/branch) ───────────────────────── */}
|
||||
{assignDialog && <AssignDialog kind={assignDialog} onClose={() => setAssignDialog(null)} />}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user