Skip to content

Commit 08f94b4

Browse files
committed
[Feat] Add authorization to EventEditor rendering based on event status and user roles
1 parent 14c193a commit 08f94b4

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/Components/Event/EventCard.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ export function EventCard({ Event }: { Event: Models.IEvent }) {
5757
<EventExtract Event={Event} />
5858
</Authorized>
5959

60-
<EventEditor Event={Event} />
60+
<Authorized rules={(groups) => {
61+
return Event.Status === EventStatus.PendingReview ||
62+
groups.some(g => g === Roles.Operators || g === Roles.Admins);
63+
}}>
64+
<EventEditor Event={Event} />
65+
</Authorized>
6166
</div>
6267
</Authorized>
6368
</div>

src/Components/Event/EventExtract.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function EventExtract({ Event }: { Event: Models.IEvent }) {
1616
return <>
1717
<ScaleButton onClick={setTrue} size="small" variant="secondary">
1818
<ScaleIconActionExport />
19-
Extract Services
19+
&nbsp;Extract Services
2020
</ScaleButton>
2121

2222
<ScaleModal

0 commit comments

Comments
 (0)