Removed grant checks.

This commit is contained in:
Mike Cao 2025-09-22 13:57:42 -07:00
parent 48c7028a3a
commit 5c9f97182e
4 changed files with 9 additions and 32 deletions

View file

@ -3,8 +3,6 @@ import { PERMISSIONS } from '@/lib/constants';
import { hasPermission } from '@/lib/auth';
import { getTeamUser, getWebsite } from '@/queries';
const cloudMode = !!process.env.CLOUD_URL;
export async function canViewWebsite({ user, shareToken }: Auth, websiteId: string) {
if (user?.isAdmin) {
return true;
@ -33,11 +31,7 @@ export async function canViewAllWebsites({ user }: Auth) {
return user.isAdmin;
}
export async function canCreateWebsite({ user, grant }: Auth) {
if (cloudMode) {
return !!grant?.find(a => a === PERMISSIONS.websiteCreate);
}
export async function canCreateWebsite({ user }: Auth) {
if (user.isAdmin) {
return true;
}