MCPcopy Create free account
hub / github.com/biersoeckli/QuickStack / isAuthorizedWriteForApp

Function isAuthorizedWriteForApp

src/server/utils/action-wrapper.utils.ts:77–92  ·  view source on GitHub ↗
(appId: string)

Source from the content-addressed store, hash-verified

75}
76
77export async function isAuthorizedWriteForApp(appId: string) {
78 const session = await getAuthUserSession();
79 if (UserGroupUtils.isAdmin(session)) {
80 return session;
81 }
82 if (!session.userGroup) {
83 console.error('User is not authorized for app: ' + appId);
84 throw new ServiceException('User is not authorized for this action.');
85 }
86 const roleHasReadAccessForApp = UserGroupUtils.sessionHasWriteAccessForApp(session, appId);
87 if (!roleHasReadAccessForApp) {
88 console.error('User is not authorized for app: ' + appId);
89 throw new ServiceException('User is not authorized for this action.');
90 }
91 return session;
92}
93
94export async function safeGetUserPermissionForApp(appId: string) {
95 const session = await getUserSession();

Callers 15

deployFunction · 0.90
stopAppFunction · 0.90
startAppFunction · 0.90
getIsDbToolActiveFunction · 0.90
deployDbToolFunction · 0.90
saveVolumeFunction · 0.90
saveFileMountFunction · 0.90

Calls 3

getAuthUserSessionFunction · 0.85
isAdminMethod · 0.80

Tested by

no test coverage detected