Allow admin/owner roles and loading state for Projects Admin access
cgen-ca480e3e4e894266ac56159b5bef407f
This commit is contained in:
parent
83844be6d3
commit
1c3980547d
1 changed files with 5 additions and 2 deletions
|
|
@ -25,8 +25,11 @@ interface Contributor {
|
|||
}
|
||||
|
||||
export default function ProjectsAdmin() {
|
||||
const { user } = useAuth();
|
||||
const isOwner = user?.email?.toLowerCase() === "mrpiglr@gmail.com";
|
||||
const { user, roles, loading: authLoading } = useAuth();
|
||||
const isOwner = Boolean(
|
||||
(user?.email?.toLowerCase() === "mrpiglr@gmail.com") ||
|
||||
(roles || []).some((r) => ["owner", "admin", "founder"].includes(String(r).toLowerCase())),
|
||||
);
|
||||
const [list, setList] = useState<any[]>([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [draft, setDraft] = useState<any>({
|
||||
|
|
|
|||
Loading…
Reference in a new issue