@univerjssheets-uifacadeclassesFpermissionsheetsuimixin

@univerjs/sheets-ui v0.5.1Docs


Class: FPermissionSheetsUIMixin

FBase is a base class for all facade classes. It provides a way to extend classes with static and instance methods. The _initialize as a special method that will be called after the constructor. You should never call it directly.

Extends

Implements

Constructors

new FPermissionSheetsUIMixin()

new FPermissionSheetsUIMixin(
   _injector, 
   _commandService, 
   _permissionService, 
   _worksheetProtectionRuleModel, 
   _rangeProtectionRuleModel, 
   _worksheetProtectionPointRuleModel, 
   _authzIoService): FPermissionSheetsUIMixin

Parameters

ParameterType
_injectorInjector
_commandServiceICommandService
_permissionServiceIPermissionService
_worksheetProtectionRuleModelWorksheetProtectionRuleModel
_rangeProtectionRuleModelRangeProtectionRuleModel
_worksheetProtectionPointRuleModelWorksheetProtectionPointModel
_authzIoServiceIAuthzIoService

Returns

FPermissionSheetsUIMixin

Inherited from

FPermission.constructor

Defined in

submodules/univer/packages/sheets/src/facade/f-permission.ts:22

Properties

PropertyModifierTypeInherited fromDefined in
_authzIoServicereadonlyIAuthzIoServiceFPermission._authzIoServicesubmodules/univer/packages/sheets/src/facade/f-permission.ts:29
_commandServicereadonlyICommandServiceFPermission._commandServicesubmodules/univer/packages/sheets/src/facade/f-permission.ts:24
_injectorreadonlyInjectorFPermission._injectorsubmodules/univer/packages/sheets/src/facade/f-permission.ts:23
_permissionServicereadonlyIPermissionServiceFPermission._permissionServicesubmodules/univer/packages/sheets/src/facade/f-permission.ts:25
_rangeProtectionRuleModelreadonlyRangeProtectionRuleModelFPermission._rangeProtectionRuleModelsubmodules/univer/packages/sheets/src/facade/f-permission.ts:27
_worksheetProtectionPointRuleModelreadonlyWorksheetProtectionPointModelFPermission._worksheetProtectionPointRuleModelsubmodules/univer/packages/sheets/src/facade/f-permission.ts:28
_worksheetProtectionRuleModelreadonlyWorksheetProtectionRuleModelFPermission._worksheetProtectionRuleModelsubmodules/univer/packages/sheets/src/facade/f-permission.ts:26

Methods

_initialize()

_initialize(): void

Returns

void

Inherited from

FPermission._initialize

Defined in

submodules/univer/packages/core/src/facade/f-base.ts:33


addRangeBaseProtection()

addRangeBaseProtection(
   unitId, 
   subUnitId, 
   ranges): Promise<undefined | {
  permissionId: string;
  ruleId: string;
}>

Adds a range protection to the worksheet.

Parameters

ParameterTypeDescription
unitIdstringThe unique identifier of the workbook.
subUnitIdstringThe unique identifier of the worksheet.
rangesIRange[]The ranges to be protected.

Returns

Promise<undefined | { permissionId: string; ruleId: string; }>

  • Returns an object containing the permissionId and ruleId if the range protection is successfully added. If the operation fails or no result is returned, it resolves to undefined. permissionId is used to stitch permission point ID,ruleId is used to store permission rules

Inherited from

FPermission.addRangeBaseProtection

Defined in

submodules/univer/packages/sheets/src/facade/f-permission.ts:168


addWorksheetBasePermission()

addWorksheetBasePermission(unitId, subUnitId): Promise<undefined | string>

This function is used to add a base permission for a worksheet.

Parameters

ParameterTypeDescription
unitIdstringThe unique identifier of the workbook for which the permission is being set.
subUnitIdstringThe unique identifier of the worksheet for which the permission is being set.

Returns

Promise<undefined | string>

  • Returns the permissionId if the permission is successfully added. If the operation fails or no result is returned, it resolves to undefined.

Inherited from

FPermission.addWorksheetBasePermission

Defined in

submodules/univer/packages/sheets/src/facade/f-permission.ts:73


removeRangeProtection()

removeRangeProtection(
   unitId, 
   subUnitId, 
   ruleIds): void

Removes the range protection from the worksheet.

Parameters

ParameterTypeDescription
unitIdstringThe unique identifier of the workbook.
subUnitIdstringThe unique identifier of the worksheet.
ruleIdsstring[]The rule IDs of the range protection to be removed.

Returns

void

Inherited from

FPermission.removeRangeProtection

Defined in

submodules/univer/packages/sheets/src/facade/f-permission.ts:217


removeWorksheetPermission()

removeWorksheetPermission(unitId, subUnitId): void

Delete the entire table protection set for the worksheet and reset the point permissions of the worksheet to true

Parameters

ParameterTypeDescription
unitIdstringThe unique identifier of the workbook for which the permission is being set.
subUnitIdstringThe unique identifier of the worksheet for which the permission is being set.

Returns

void

Inherited from

FPermission.removeWorksheetPermission

Defined in

submodules/univer/packages/sheets/src/facade/f-permission.ts:100


setPermissionDialogVisible()

setPermissionDialogVisible(visible): void

Set visibility of unauthorized pop-up window

Parameters

ParameterType
visibleboolean

Returns

void

Implementation of

IFPermissionSheetsUIMixin.setPermissionDialogVisible

Overrides

FPermission.setPermissionDialogVisible

Defined in

submodules/univer/packages/sheets-ui/src/facade/f-permission.ts:29


setRangeProtectionPermissionPoint()

setRangeProtectionPermissionPoint(
   unitId, 
   subUnitId, 
   permissionId, 
   FPointClass, 
   value): void

Modify the permission points of a custom area

Parameters

ParameterTypeDescription
unitIdstringThe unique identifier of the workbook.
subUnitIdstringThe unique identifier of the worksheet within the workbook.
permissionIdstringThe unique identifier of the permission that controls access to the range.
FPointClassRangePermissionPointConstructorThe constructor for the range permission point class. See the permission-point documentation for more details.
valuebooleanThe new permission value to be set for the range (e.g., true for allowing access, false for restricting access).

Returns

void

Inherited from

FPermission.setRangeProtectionPermissionPoint

Defined in

submodules/univer/packages/sheets/src/facade/f-permission.ts:246


setRangeProtectionRanges()

setRangeProtectionRanges(
   unitId, 
   subUnitId, 
   ruleId, 
   ranges): void

Sets the ranges for range protection in a worksheet.

This method finds the rule by unitId, subUnitId, and ruleId, and updates the rule with the provided ranges. It checks for overlaps with existing ranges in the same subunit and shows an error message if any overlap is detected. If no overlap is found, it executes the command to update the range protection with the new ranges.

Parameters

ParameterTypeDescription
unitIdstringThe unique identifier of the workbook.
subUnitIdstringThe unique identifier of the worksheet within the workbook.
ruleIdstringThe ruleId of the range protection rule that is being updated.
rangesIRange[]The array of new ranges to be set for the range protection rule.

Returns

void

Inherited from

FPermission.setRangeProtectionRanges

Defined in

submodules/univer/packages/sheets/src/facade/f-permission.ts:267


setWorkbookEditPermission()

setWorkbookEditPermission(unitId, value): void

This function is used to set whether the workbook can be edited

Parameters

ParameterTypeDescription
unitIdstringThe unique identifier of the workbook for which the permission is being set.
valuebooleanA value that controls whether the workbook can be edited

Returns

void

Inherited from

FPermission.setWorkbookEditPermission

Defined in

submodules/univer/packages/sheets/src/facade/f-permission.ts:61


setWorkbookPermissionPoint()

setWorkbookPermissionPoint(
   unitId, 
   FPointClass, 
   value): void

Configures a specific permission point for a workbook.

This function sets or updates a permission point for a workbook identified by unitId. It creates a new permission point if it does not already exist, and updates the point with the provided value.

Parameters

ParameterTypeDescription
unitIdstringThe unique identifier of the workbook for which the permission is being set.
FPointClassWorkbookPermissionPointConstructorThe constructor function for creating a permission point instance. Other point constructors can See the permission-point documentation for more details.
valuebooleanThe boolean value to determine whether the permission point is enabled or disabled.

Returns

void

Inherited from

FPermission.setWorkbookPermissionPoint

Defined in

submodules/univer/packages/sheets/src/facade/f-permission.ts:45


setWorksheetPermissionPoint()

setWorksheetPermissionPoint(
   unitId, 
   subUnitId, 
   FPointClass, 
value): Promise<undefined | string>

Sets the worksheet permission point by updating or adding the permission point for the worksheet. If the worksheet doesn’t have a base permission, it creates one to used render

Parameters

ParameterTypeDescription
unitIdstringThe unique identifier of the workbook.
subUnitIdstringThe unique identifier of the worksheet.
FPointClassWorkSheetPermissionPointConstructorThe constructor for the permission point class. See the permission-point documentation for more details.
valuebooleanThe new permission value to be set for the worksheet.

Returns

Promise<undefined | string>

  • Returns the permissionId if the permission point is successfully set or created. If no permission is set, it resolves to undefined.

Inherited from

FPermission.setWorksheetPermissionPoint

Defined in

submodules/univer/packages/sheets/src/facade/f-permission.ts:125


extend()

static extend(source): void

Parameters

ParameterType
sourceany

Returns

void

Inherited from

FPermission.extend

Defined in

submodules/univer/packages/core/src/facade/f-base.ts:35