Skip to content

Commit

Permalink
fix: Permissions on Admin pages (#3959)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-robitaille authored Jul 5, 2024
1 parent 349d4aa commit 9e129b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ export default async function Page() {

const { ability } = await authCheckAndRedirect();

checkPrivilegesAsBoolean(ability, [{ action: "create", subject: "FormRecord" }], {
redirect: true,
});
checkPrivilegesAsBoolean(
ability,
[{ action: "update", subject: { type: "FormRecord", object: {} } }],
{
redirect: true,
}
);
return (
<>
<h1>{t("upload.title")}</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ export default async function Page() {

checkPrivilegesAsBoolean(
ability,
[
{ action: "view", subject: "FormRecord" },
{ action: "update", subject: "FormRecord" },
],
{ logic: "one", redirect: true }
[{ action: "update", subject: { type: "FormRecord", object: {} } }],
{ redirect: true }
);

const templates = (await getAllTemplates(ability)).map((template) => {
Expand Down

0 comments on commit 9e129b3

Please sign in to comment.