mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-03 03:14:34 -05:00
fix pricing desc in billing, add plan to user session, add permissions check to Invite API
This commit is contained in:
@@ -55,6 +55,21 @@ export const hasEnvironmentAccess = async (user, environmentId) => {
|
||||
return false;
|
||||
};
|
||||
|
||||
export const hasTeamAccess = async (user, teamId) => {
|
||||
const membership = await prisma.membership.findUnique({
|
||||
where: {
|
||||
userId_teamId: {
|
||||
userId: user.id,
|
||||
teamId: teamId,
|
||||
},
|
||||
},
|
||||
});
|
||||
if (membership) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
export const getSessionOrUser = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
// check for session (browser usage)
|
||||
let session: any = await getServerSession(req, res, authOptions);
|
||||
|
||||
Reference in New Issue
Block a user