Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(permission): update default permission values to false (#6206)

WEI ZHANG93ce16e4d0d5
diff --git a/packages/sheets/src/model/range-protection.cache.ts b/packages/sheets/src/model/range-protection.cache.ts
index 6838687e16..80fdee5311 100644
--- a/packages/sheets/src/model/range-protection.cache.ts
+++ b/packages/sheets/src/model/range-protection.cache.ts
@@ -189,8 +189,8 @@ export class RangeProtectionCache extends Disposable {
}
private _getSelectionActions(unitId: string, subUnitId: string, rule: IRangeProtectionRule) {
- const edit = this._permissionService.getPermissionPoint(new RangeProtectionPermissionEditPoint(unitId, subUnitId, rule.permissionId)?.id)?.value ?? true;
- const view = this._permissionService.getPermissionPoint(new RangeProtectionPermissionViewPoint(unitId, subUnitId, rule.permissionId)?.id)?.value ?? true;
+ const edit = this._permissionService.getPermissionPoint(new RangeProtectionPermissionEditPoint(unitId, subUnitId, rule.permissionId)?.id)?.value ?? false;
+ const view = this._permissionService.getPermissionPoint(new RangeProtectionPermissionViewPoint(unitId, subUnitId, rule.permissionId)?.id)?.value ?? false;
const manageProtection = this._permissionService.getPermissionPoint(new RangeProtectionPermissionManageCollaPoint(unitId, subUnitId, rule.permissionId)?.id)?.value ?? false;
const deleteProtection = this._permissionService.getPermissionPoint(new RangeProtectionPermissionDeleteProtectionPoint(unitId, subUnitId, rule.permissionId)?.id)?.value ?? false;
const selectionProtection = {
diff --git a/packages/sheets/src/services/permission/permission-point/range/view.ts b/packages/sheets/src/services/permission/permission-point/range/view.ts
index 3287cd0ef8..bc44f45827 100644
--- a/packages/sheets/src/services/permission/permission-point/range/view.ts
+++ b/packages/sheets/src/services/permission/permission-point/range/view.ts
@@ -22,7 +22,7 @@ export class RangeProtectionPermissionViewPoint implements IPermissionPoint {
type = UnitObject.SelectRange;
subType = UnitAction.View;
status = PermissionStatus.INIT;
- value = true;
+ value = false;
id: string;
unitId: string;
subUnitId: string;