Harden archive organization scoping
Validate ArchiveUser organization input against the loaded profile and\nuse the profile organization for owner checks and webhook emission.\n\nAlso disable both PersonPage destructive actions while either archive\nor remove mutation is pending to prevent double-submit races. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
committed by
Bryan Frimin
parent
7bb3c144a3
commit
f50289a755
@@ -89,6 +89,7 @@ export function PersonPage(props: { queryRef: PreloadedQuery<PersonPageQuery> })
|
||||
errorMessage: __("Failed to remove person"),
|
||||
},
|
||||
);
|
||||
const isMutating = isArchiving || isRemoving;
|
||||
|
||||
const handleArchive = () => {
|
||||
confirm(
|
||||
@@ -171,7 +172,7 @@ export function PersonPage(props: { queryRef: PreloadedQuery<PersonPageQuery> })
|
||||
<DropdownItem
|
||||
icon={IconArchive}
|
||||
onClick={handleArchive}
|
||||
disabled={isArchiving}
|
||||
disabled={isMutating}
|
||||
>
|
||||
{__("Archive")}
|
||||
</DropdownItem>
|
||||
@@ -181,7 +182,7 @@ export function PersonPage(props: { queryRef: PreloadedQuery<PersonPageQuery> })
|
||||
variant="danger"
|
||||
icon={IconTrashCan}
|
||||
onClick={handleRemove}
|
||||
disabled={isRemoving}
|
||||
disabled={isMutating}
|
||||
>
|
||||
{__("Remove")}
|
||||
</DropdownItem>
|
||||
|
||||
Reference in New Issue
Block a user