upd: akses user role developer
Deskripsi: - update akses list divisi - update akses detail divisi - update akses tambah divisi - update akses laporan divisi No Issues
This commit is contained in:
@@ -44,7 +44,7 @@ export async function GET(request: Request) {
|
||||
|
||||
|
||||
// JIKA ROLE = USER ATAU COADMIN DAN KATEGORI != SEMUA (DIVISI SAYA)
|
||||
if (roleUser != "supadmin" && roleUser != "cosupadmin" && roleUser != "admin") {
|
||||
if (roleUser != "supadmin" && roleUser != "developer" && roleUser != "cosupadmin" && roleUser != "admin") {
|
||||
if (kategori != "semua") {
|
||||
kondisi = {
|
||||
isActive: active == 'false' ? false : true,
|
||||
|
||||
@@ -8,11 +8,11 @@ import { useMediaQuery, useShallowEffect } from "@mantine/hooks";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { HiChevronLeft } from "react-icons/hi2";
|
||||
import { IoIosArrowDropright } from "react-icons/io";
|
||||
import { globalMemberDivision } from "../lib/val_division";
|
||||
import NavbarAdminDivision from "./navbar_admin_division";
|
||||
import NavbarCreateUsers from "./navbar_create_users";
|
||||
import { HiChevronLeft } from "react-icons/hi2";
|
||||
|
||||
export default function CreateDivision() {
|
||||
const router = useRouter();
|
||||
@@ -59,7 +59,7 @@ export default function CreateDivision() {
|
||||
}
|
||||
|
||||
function onToChooseAnggota() {
|
||||
if (roleUser == "supadmin" && (body.idGroup == "" || String(body.idGroup) == "null"))
|
||||
if ((roleUser == "supadmin" || roleUser == "developer") && (body.idGroup == "" || String(body.idGroup) == "null"))
|
||||
return toast.error("Error! lembaga desa tidak boleh kosong")
|
||||
setChooseAnggota(true)
|
||||
}
|
||||
@@ -98,7 +98,7 @@ export default function CreateDivision() {
|
||||
|
||||
function checkAll() {
|
||||
let nilai = true
|
||||
if (roleUser == "supadmin" && (body.idGroup === "" || String(body.idGroup) == "null")) {
|
||||
if ((roleUser == "supadmin" || roleUser == "developer") && (body.idGroup === "" || String(body.idGroup) == "null")) {
|
||||
setTouched(touched => ({ ...touched, idGroup: true }))
|
||||
nilai = false
|
||||
}
|
||||
@@ -145,7 +145,7 @@ export default function CreateDivision() {
|
||||
<Box p={20}>
|
||||
<Stack>
|
||||
{
|
||||
(roleUser == "supadmin") && (
|
||||
(roleUser == "supadmin" || roleUser == "developer") && (
|
||||
<Select
|
||||
placeholder="Lembaga Desa"
|
||||
label="Lembaga Desa"
|
||||
|
||||
@@ -111,7 +111,7 @@ export default function CreateReport() {
|
||||
setTampil(false)
|
||||
} else {
|
||||
setTouched({ ...touched, end_date: false })
|
||||
if (roleLogin.get() == "supadmin" && (isGroup == "" || isGroup == null || isGroup == undefined)) {
|
||||
if ((roleLogin.get() == "supadmin" || roleLogin.get() == "developer") && (isGroup == "" || isGroup == null || isGroup == undefined)) {
|
||||
setTampil(false)
|
||||
} else {
|
||||
onReport(isGroup, val, valueAkhir)
|
||||
@@ -127,7 +127,7 @@ export default function CreateReport() {
|
||||
setTampil(false)
|
||||
} else {
|
||||
setTouched({ ...touched, end_date: false })
|
||||
if (roleLogin.get() == "supadmin" && (isGroup == "" || isGroup == null || isGroup == undefined)) {
|
||||
if ((roleLogin.get() == "supadmin" || roleLogin.get() == "developer") && (isGroup == "" || isGroup == null || isGroup == undefined)) {
|
||||
setTampil(false)
|
||||
} else {
|
||||
onReport(isGroup, value, val)
|
||||
@@ -147,7 +147,7 @@ export default function CreateReport() {
|
||||
<LayoutNavbarNew back="/division" title="Laporan Divisi" menu />
|
||||
<Box p={20}>
|
||||
<Stack>
|
||||
{roleLogin.get() == "supadmin" &&
|
||||
{(roleLogin.get() == "supadmin" || roleLogin.get() == "developer") &&
|
||||
<Select
|
||||
placeholder="Lembaga Desa"
|
||||
label="Lembaga Desa"
|
||||
|
||||
@@ -3,7 +3,6 @@ import { globalRole, TEMA } from '@/module/_global';
|
||||
import { useHookstate } from '@hookstate/core';
|
||||
import { Box, Flex, SimpleGrid, Stack, Text } from '@mantine/core';
|
||||
import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import React from 'react';
|
||||
import { HiOutlineFilter } from 'react-icons/hi';
|
||||
import { IoAddCircle } from 'react-icons/io5';
|
||||
import { TbReportAnalytics } from "react-icons/tb";
|
||||
@@ -18,9 +17,7 @@ export default function DrawerDivision() {
|
||||
return (
|
||||
<Box>
|
||||
<Stack pt={10}>
|
||||
<SimpleGrid
|
||||
cols={{ base: 3, sm: 3, lg: 3 }}
|
||||
>
|
||||
<SimpleGrid cols={{ base: 3, sm: 3, lg: 3 }} >
|
||||
<Flex onClick={() => router.push('/division/create')} justify={'center'} align={'center'} direction={'column'} >
|
||||
<Box>
|
||||
<IoAddCircle size={30} color={tema.get().utama} />
|
||||
@@ -30,7 +27,7 @@ export default function DrawerDivision() {
|
||||
</Box>
|
||||
</Flex>
|
||||
{
|
||||
roleLogin.get() == "supadmin" &&
|
||||
(roleLogin.get() == "supadmin" || roleLogin.get() == "developer") &&
|
||||
<Flex onClick={() => {
|
||||
router.push('/division?page=filter&group=' + group)
|
||||
}} justify={'center'} align={'center'} direction={'column'} >
|
||||
@@ -44,7 +41,7 @@ export default function DrawerDivision() {
|
||||
}
|
||||
|
||||
{
|
||||
(roleLogin.get() == "supadmin" || roleLogin.get() == "cosupadmin") &&
|
||||
(roleLogin.get() == "supadmin" || roleLogin.get() == "cosupadmin" || roleLogin.get() == "developer") &&
|
||||
<Flex onClick={() => {
|
||||
router.push('/division?page=report')
|
||||
}} justify={'center'} align={'center'} direction={'column'} >
|
||||
|
||||
@@ -157,7 +157,7 @@ export default function ListDivision() {
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Box pt={20}>
|
||||
{roleLogin.get() == 'supadmin' && <Text>Filter : {nameGroup}</Text>}
|
||||
{(roleLogin.get() == 'supadmin' || roleLogin.get() == 'developer') && <Text>Filter : {nameGroup}</Text>}
|
||||
<Box bg={tema.get().bgTotalKegiatan} p={10} style={{ borderRadius: 10 }}>
|
||||
<Text fw={'bold'} c={tema.get().utama}>Total Divisi</Text>
|
||||
<Flex justify={'center'} align={'center'} h={'100%'}>
|
||||
|
||||
Reference in New Issue
Block a user