mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-21 15:33:45 +00:00
🚥 fix: Preserve Insights With Guarded ACL Role Updates (#16170)
* fix: preserve Insights with guarded ACL role updates * test: settle ACL index builds before opening the transaction * fix: replace ACL mask partitions with single-operator bit writes * style: drop the now-unused RoleBits import * fix: make ACL role replacement one atomic guarded write * fix: export the permission write retry ceiling * fix: retry ACL mutations per document and preserve atomic permissions --------- Co-authored-by: Lia <lia@librechat.ai>
This commit is contained in:
parent
cae9afd807
commit
1e2142e52a
12 changed files with 897 additions and 39 deletions
|
|
@ -173,6 +173,7 @@ const updateResourcePermissions = async (req, res) => {
|
|||
const results = await bulkUpdateResourcePermissions({
|
||||
resourceType,
|
||||
resourceId,
|
||||
maxWriteAttempts: req.config?.config?.permissions?.maxWriteAttempts,
|
||||
updatedPrincipals: validatedPrincipals,
|
||||
revokedPrincipals,
|
||||
grantedBy: userId,
|
||||
|
|
|
|||
|
|
@ -339,8 +339,12 @@ describe('PermissionsController', () => {
|
|||
});
|
||||
const res = createMockRes();
|
||||
|
||||
req.config = { config: { permissions: { maxWriteAttempts: 7 } } };
|
||||
await updateResourcePermissions(req, res);
|
||||
|
||||
expect(mockBulkUpdateResourcePermissions).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ maxWriteAttempts: 7 }),
|
||||
);
|
||||
expect(mockRecordAuditEntry).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
action: 'permission.insights_assigned',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue