mirror of
https://github.com/HeyPuter/puter.git
synced 2026-10-05 03:18:30 +00:00
fix: permission writeback to flat kv perissions (#1774)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
This commit is contained in:
@@ -245,16 +245,17 @@ class PermissionService extends BaseService {
|
||||
const linkedPermsReading = await linkedPermsReadingPromise;
|
||||
const options = PermissionUtil.reading_to_options(linkedPermsReading);
|
||||
|
||||
options.forEach((perm, index) => {
|
||||
const possiblePerm = linkedPermsReading[index];
|
||||
this.kvService.set({
|
||||
key: PermissionUtil.join(PERM_KEY_PREFIX, actor.type.user.id, perm.permission),
|
||||
value: {
|
||||
permission: perm.permission,
|
||||
issuer_user_id: possiblePerm.data.issuer_user_id,
|
||||
...perm.data,
|
||||
},
|
||||
});
|
||||
options.forEach((perm) => {
|
||||
if ( perm.permission ){
|
||||
this.kvService.set({
|
||||
key: PermissionUtil.join(PERM_KEY_PREFIX, actor.type.user.id, perm.permission),
|
||||
value: {
|
||||
permission: perm.permission,
|
||||
issuer_user_id: perm.data?.[0]?.issuer_user_id,
|
||||
data: perm.data,
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
return flatPermsReading;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user