mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-22 02:06:12 +01:00
chore: address ESLint errors
This commit is contained in:
parent
5512c55d71
commit
f8c8b89f4d
6 changed files with 86 additions and 60 deletions
|
|
@ -188,7 +188,10 @@ const getUserOwnedEntraGroups = async (accessToken, sub) => {
|
|||
try {
|
||||
const graphClient = await createGraphClient(accessToken, sub);
|
||||
|
||||
const groupsResponse = await graphClient.api('/me/ownedObjects/microsoft.graph.group').select('id').get();
|
||||
const groupsResponse = await graphClient
|
||||
.api('/me/ownedObjects/microsoft.graph.group')
|
||||
.select('id')
|
||||
.get();
|
||||
|
||||
return (groupsResponse.value || []).map((group) => group.id);
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ describe('GraphApiService', () => {
|
|||
beforeEach(async () => {
|
||||
jest.clearAllMocks();
|
||||
await mongoose.connection.dropDatabase();
|
||||
|
||||
|
||||
// Set up environment variable for People.Read scope
|
||||
process.env.OPENID_GRAPH_SCOPES = 'User.Read,People.Read,Group.Read.All';
|
||||
|
||||
|
|
|
|||
|
|
@ -484,7 +484,7 @@ const hasPublicPermission = async ({ resourceType, resourceId, requiredPermissio
|
|||
|
||||
// Use public principal to check permissions
|
||||
const publicPrincipal = [{ principalType: 'public' }];
|
||||
|
||||
|
||||
const entries = await findEntriesByPrincipalsAndResource(
|
||||
publicPrincipal,
|
||||
resourceType,
|
||||
|
|
@ -492,7 +492,7 @@ const hasPublicPermission = async ({ resourceType, resourceId, requiredPermissio
|
|||
);
|
||||
|
||||
// Check if any entry has the required permission bits
|
||||
return entries.some(entry => (entry.permBits & requiredPermissions) === requiredPermissions);
|
||||
return entries.some((entry) => (entry.permBits & requiredPermissions) === requiredPermissions);
|
||||
} catch (error) {
|
||||
logger.error(`[PermissionService.hasPublicPermission] Error: ${error.message}`);
|
||||
// Re-throw validation errors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue