Skip to content

Commit 9ea7d6e

Browse files
committed
update permissions and error handling
1 parent 0d5a352 commit 9ea7d6e

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

apps/blade/src/app/_components/issue-list/issues-list.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function IssuesList() {
4343
toast.success("Issue deleted successfully");
4444
},
4545
onError: (error) => {
46-
toast.error(error.message || "Failed to delete issue");
46+
toast.error("Failed to delete issue");
4747
},
4848
});
4949

@@ -130,7 +130,9 @@ export function IssuesList() {
130130
)}
131131

132132
{!isLoading && error && (
133-
<div className="px-4 py-8 text-sm text-destructive">{error}</div>
133+
<div className="px-4 py-8 text-sm text-destructive">
134+
Unable to load issues. Please try again.
135+
</div>
134136
)}
135137

136138
{!isLoading && !error && issues.length === 0 && (

apps/blade/src/app/issues/list/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ export default async function IssueListPage() {
1111
const session = await auth();
1212
if (!session) redirect(SIGN_IN_PATH);
1313

14-
const hasAccess = await api.roles.hasPermission({ or: ["READ_ISSUES"] });
14+
const hasAccess = await api.roles.hasPermission({
15+
and: [
16+
"READ_ISSUES",
17+
"EDIT_ISSUES",
18+
"EDIT_ISSUE_TEMPLATES",
19+
"READ_ISSUE_TEMPLATES",
20+
],
21+
});
1522
if (!hasAccess) notFound();
1623

1724
return (

0 commit comments

Comments
 (0)