fix(org): show the project-membership editor for supervisor/pm roles without panels
Supervisors are scoped by project membership (and are blocked at login without one), but the editor was hidden unless the user had a panel — a coordinator could never be given a project. Backend always allowed it.
This commit is contained in:
@@ -212,6 +212,9 @@ export function OrganizationPage() {
|
|||||||
{users.map((u) => {
|
{users.map((u) => {
|
||||||
const isAdmin = u.role === "admin";
|
const isAdmin = u.role === "admin";
|
||||||
const hasPanel = Boolean(u.panels?.procurement || u.panels?.inventory || u.panels?.pm);
|
const hasPanel = Boolean(u.panels?.procurement || u.panels?.inventory || u.panels?.pm);
|
||||||
|
// سرپرست/مدیر پروژه بدون پنل هم عضویت پروژهای میخواهد —
|
||||||
|
// ورود سرپرست بدون پروژه مسدود است، پس ویرایشگر باید باز باشد
|
||||||
|
const canAssignProjects = hasPanel || u.role === "supervisor" || u.role === "pm";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr key={u.id} className="border-b border-line/50 transition-colors hover:bg-canvas/30">
|
<tr key={u.id} className="border-b border-line/50 transition-colors hover:bg-canvas/30">
|
||||||
@@ -320,7 +323,7 @@ export function OrganizationPage() {
|
|||||||
<td className="py-2.5">
|
<td className="py-2.5">
|
||||||
{isAdmin ? (
|
{isAdmin ? (
|
||||||
<span className="text-[11px] text-muted">دسترسی خودکار به تمام پروژهها</span>
|
<span className="text-[11px] text-muted">دسترسی خودکار به تمام پروژهها</span>
|
||||||
) : hasPanel ? (
|
) : canAssignProjects ? (
|
||||||
<div className="w-72">
|
<div className="w-72">
|
||||||
<ProjectMultiSelect
|
<ProjectMultiSelect
|
||||||
options={projects.map((p) => ({ id: p.id, name: p.name }))}
|
options={projects.map((p) => ({ id: p.id, name: p.name }))}
|
||||||
|
|||||||
Reference in New Issue
Block a user