develpoer role
CI/CD Pipeline / Build and Push PocketBase Docker Image (push) Successful in 10s
CI/CD Pipeline / i18n Catalog Check (push) Successful in 43s
CI/CD Pipeline / Build and Push App Docker Image (push) Successful in 2m14s
CI/CD Pipeline / Deploy to Kubernetes (push) Successful in 8m29s
CI/CD Pipeline / Build and Push PocketBase Docker Image (push) Successful in 10s
CI/CD Pipeline / i18n Catalog Check (push) Successful in 43s
CI/CD Pipeline / Build and Push App Docker Image (push) Successful in 2m14s
CI/CD Pipeline / Deploy to Kubernetes (push) Successful in 8m29s
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import { useAuth } from "@/contexts/auth-context";
|
||||
import { isDeveloperRole } from "../utils/roles";
|
||||
|
||||
export const useIsDeveloper = (): boolean => {
|
||||
const { roles } = useAuth();
|
||||
return isDeveloperRole(roles);
|
||||
};
|
||||
@@ -1,4 +1,8 @@
|
||||
export const ADMIN_ROLE = "Admin";
|
||||
export const DEVELOPER_ROLE = "Developer";
|
||||
|
||||
export const isDeveloperRole = (roles?: string[] | null): boolean =>
|
||||
!!roles?.includes(DEVELOPER_ROLE);
|
||||
|
||||
export const isAdminRole = (roles?: string[] | null): boolean =>
|
||||
!!roles?.includes(ADMIN_ROLE);
|
||||
!!roles?.includes(ADMIN_ROLE) || isDeveloperRole(roles);
|
||||
|
||||
Reference in New Issue
Block a user