Skip to content

Commit b115039

Browse files
committed
fix: adjustment for eventus and inspice
Eventus: bisa create dan update STATE, gak bisa absen Inspice: cuma bisa absen STATE
1 parent d6318ec commit b115039

File tree

1 file changed

+11
-3
lines changed
  • app/dashboard/state/details/[stateID]

1 file changed

+11
-3
lines changed

app/dashboard/state/details/[stateID]/page.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ export default function Details() {
175175

176176
const allowedEditPanitia = ["D01", "D02", "D05", "D13"]; // divisi registrasi?
177177

178+
// exclude divisi D13 - Inspice (registrasi)
179+
// cursed banget :(
180+
const isSuntingAllowed =
181+
auth.role === "organisator" ||
182+
(auth.role === "panit" &&
183+
allowedEditPanitia.includes(auth.user?.divisiID!) &&
184+
auth.user?.divisiID !== "D13");
185+
178186
const columnsDetails: MUIDataTableColumn[] = [
179187
{
180188
label: "Nama",
@@ -231,6 +239,7 @@ export default function Details() {
231239
disabled={
232240
auth.role !== "panit" ||
233241
!allowedEditPanitia.includes(auth.user?.divisiID!) ||
242+
auth.user?.divisiID === "D05" ||
234243
value
235244
}
236245
/>
@@ -272,6 +281,7 @@ export default function Details() {
272281
disabled={
273282
auth.role !== "panit" ||
274283
!allowedEditPanitia.includes(auth.user?.divisiID!) ||
284+
auth.user?.divisiID === "D05" ||
275285
value
276286
}
277287
/>
@@ -290,9 +300,7 @@ export default function Details() {
290300
showDashboardButton={auth.role === "organisator"}
291301
>
292302
<Box w={"full"} h={"auto"}>
293-
{(auth.role === "organisator" ||
294-
(auth.role === "panit" &&
295-
allowedEditPanitia.includes(auth.user?.divisiID!))) && (
303+
{isSuntingAllowed && (
296304
<Flex justifyContent={"flex-end"} mb={"2em"}>
297305
<Button
298306
h={"2.25em"}

0 commit comments

Comments
 (0)