research/publish: gate approve+reject on Owner role (#4)
This commit was merged in pull request #4.
This commit is contained in:
@@ -88,11 +88,16 @@ export function ResearchCanvas({
|
||||
agents,
|
||||
refreshKey,
|
||||
onChanged,
|
||||
canApprovePublish = false,
|
||||
}: {
|
||||
selectedId: string | null;
|
||||
agents: Agent[];
|
||||
refreshKey: number;
|
||||
onChanged: () => void;
|
||||
/** True when the current user is a workspace Owner. Members can request
|
||||
* publish but not decide it — matches the server's Role::Owner guard on
|
||||
* POST /api/research/publish-approvals/:id/{approve,reject}. */
|
||||
canApprovePublish?: boolean;
|
||||
}) {
|
||||
const [topic, setTopic] = useState<TopicDetail | null>(null);
|
||||
const [pendingApproval, setPendingApproval] = useState<PublishApproval | null>(null);
|
||||
@@ -742,7 +747,9 @@ export function ResearchCanvas({
|
||||
</span>
|
||||
</div>
|
||||
<div style={{ fontFamily: mono, fontSize: 11, color: "#cfcfd5", lineHeight: 1.55 }}>
|
||||
Any workspace member can decide.{" "}
|
||||
{canApprovePublish
|
||||
? "Workspace owners decide publish."
|
||||
: "A workspace owner needs to approve or reject."}{" "}
|
||||
{boundApproval ? (
|
||||
<>
|
||||
Requested{" "}
|
||||
@@ -752,6 +759,7 @@ export function ResearchCanvas({
|
||||
"Loading approval…"
|
||||
)}
|
||||
</div>
|
||||
{canApprovePublish ? (
|
||||
<div style={{ display: "flex", gap: 8, flexWrap: "wrap" }}>
|
||||
<button
|
||||
type="button"
|
||||
@@ -802,6 +810,7 @@ export function ResearchCanvas({
|
||||
Reject
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
{rejectFormOpen ? (
|
||||
<div
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user