add launcher user app permission management
This commit is contained in:
@@ -269,3 +269,32 @@ export function revokeUserLicense(userLicenseId: string) {
|
||||
method: 'DELETE'
|
||||
});
|
||||
}
|
||||
|
||||
export type LauncherUserAppPermission = {
|
||||
appId: string;
|
||||
appKey: string;
|
||||
displayName: string;
|
||||
description?: string | null;
|
||||
sortOrder: number;
|
||||
isEnabled: boolean;
|
||||
permissionId?: string | null;
|
||||
canView: boolean;
|
||||
canLaunch: boolean;
|
||||
assignedAt?: string | null;
|
||||
};
|
||||
|
||||
export async function loadLauncherUserAppPermissions(userId: string) {
|
||||
const response = await apiRequest<{ permissions?: LauncherUserAppPermission[] }>(`/launcher/users/${userId}/app-permissions`);
|
||||
return response.permissions ?? [];
|
||||
}
|
||||
|
||||
export function updateLauncherUserAppPermissions(userId: string, permissions: Array<{
|
||||
appKey: string;
|
||||
canView: boolean;
|
||||
canLaunch: boolean;
|
||||
}>) {
|
||||
return apiRequest<{ permissions?: LauncherUserAppPermission[] }>(`/launcher/users/${userId}/app-permissions`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ permissions })
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user