Class: FPermission
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:22
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
Extended by
Constructors
new FPermission()
new FPermission(
_injector,
_commandService,
_permissionService,
_worksheetProtectionRuleModel,
_rangeProtectionRuleModel,
_worksheetProtectionPointRuleModel,
_authzIoService): FPermission
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:27
Parameters
Parameter | Type |
---|---|
_injector | Injector |
_commandService | ICommandService |
_permissionService | IPermissionService |
_worksheetProtectionRuleModel | WorksheetProtectionRuleModel |
_rangeProtectionRuleModel | RangeProtectionRuleModel |
_worksheetProtectionPointRuleModel | WorksheetProtectionPointModel |
_authzIoService | IAuthzIoService |
Returns
Overrides
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_authzIoService | readonly | IAuthzIoService | undefined | - | submodules/univer/packages/sheets/src/facade/f-permission.ts:34 |
_commandService | readonly | ICommandService | undefined | - | submodules/univer/packages/sheets/src/facade/f-permission.ts:29 |
_disposed | protected | boolean | false | FBase ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
_injector | readonly | Injector | undefined | - | submodules/univer/packages/sheets/src/facade/f-permission.ts:28 |
_permissionService | readonly | IPermissionService | undefined | - | submodules/univer/packages/sheets/src/facade/f-permission.ts:30 |
_rangeProtectionRuleModel | readonly | RangeProtectionRuleModel | undefined | - | submodules/univer/packages/sheets/src/facade/f-permission.ts:32 |
_worksheetProtectionPointRuleModel | readonly | WorksheetProtectionPointModel | undefined | - | submodules/univer/packages/sheets/src/facade/f-permission.ts:33 |
_worksheetProtectionRuleModel | readonly | WorksheetProtectionRuleModel | undefined | - | submodules/univer/packages/sheets/src/facade/f-permission.ts:31 |
permissionPointsDefinition | public | { RangeProtectionPermissionEditPoint : typeof RangeProtectionPermissionEditPoint ; RangeProtectionPermissionViewPoint : typeof RangeProtectionPermissionViewPoint ; WorkbookCommentPermission : typeof WorkbookCommentPermission ; WorkbookCopyPermission : typeof WorkbookCopyPermission ; WorkbookCreateProtectPermission : typeof WorkbookCreateProtectPermission ; WorkbookCreateSheetPermission : typeof WorkbookCreateSheetPermission ; WorkbookDeleteSheetPermission : typeof WorkbookDeleteSheetPermission ; WorkbookDuplicatePermission : typeof WorkbookDuplicatePermission ; WorkbookEditablePermission : typeof WorkbookEditablePermission ; WorkbookExportPermission : typeof WorkbookExportPermission ; WorkbookHideSheetPermission : typeof WorkbookHideSheetPermission ; WorkbookHistoryPermission : typeof WorkbookHistoryPermission ; WorkbookManageCollaboratorPermission : typeof WorkbookManageCollaboratorPermission ; WorkbookMoveSheetPermission : typeof WorkbookMoveSheetPermission ; WorkbookPrintPermission : typeof WorkbookPrintPermission ; WorkbookRecoverHistoryPermission : typeof WorkbookRecoverHistoryPermission ; WorkbookRenameSheetPermission : typeof WorkbookRenameSheetPermission ; WorkbookSharePermission : typeof WorkbookSharePermission ; WorkbookViewHistoryPermission : typeof WorkbookViewHistoryPermission ; WorkbookViewPermission : typeof WorkbookViewPermission ; WorksheetCopyPermission : typeof WorksheetCopyPermission ; WorksheetDeleteColumnPermission : typeof WorksheetDeleteColumnPermission ; WorksheetDeleteProtectionPermission : typeof WorksheetDeleteProtectionPermission ; WorksheetDeleteRowPermission : typeof WorksheetDeleteRowPermission ; WorksheetEditExtraObjectPermission : typeof WorksheetEditExtraObjectPermission ; WorksheetEditPermission : typeof WorksheetEditPermission ; WorksheetFilterPermission : typeof WorksheetFilterPermission ; WorksheetInsertColumnPermission : typeof WorksheetInsertColumnPermission ; WorksheetInsertHyperlinkPermission : typeof WorksheetInsertHyperlinkPermission ; WorksheetInsertRowPermission : typeof WorksheetInsertRowPermission ; WorksheetManageCollaboratorPermission : typeof WorksheetManageCollaboratorPermission ; WorksheetPivotTablePermission : typeof WorksheetPivotTablePermission ; WorksheetSelectProtectedCellsPermission : typeof WorksheetSelectProtectedCellsPermission ; WorksheetSelectUnProtectedCellsPermission : typeof WorksheetSelectUnProtectedCellsPermission ; WorksheetSetCellStylePermission : typeof WorksheetSetCellStylePermission ; WorksheetSetCellValuePermission : typeof WorksheetSetCellValuePermission ; WorksheetSetColumnStylePermission : typeof WorksheetSetColumnStylePermission ; WorksheetSetRowStylePermission : typeof WorksheetSetRowStylePermission ; WorksheetSortPermission : typeof WorksheetSortPermission ; WorksheetViewPermission : typeof WorksheetViewPermission ; } | PermissionPointsDefinitions | - | submodules/univer/packages/sheets/src/facade/f-permission.ts:23 |
permissionPointsDefinition.RangeProtectionPermissionEditPoint | public | typeof RangeProtectionPermissionEditPoint | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:99 |
permissionPointsDefinition.RangeProtectionPermissionViewPoint | public | typeof RangeProtectionPermissionViewPoint | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:100 |
permissionPointsDefinition.WorkbookCommentPermission | public | typeof WorkbookCommentPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:59 |
permissionPointsDefinition.WorkbookCopyPermission | public | typeof WorkbookCopyPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:60 |
permissionPointsDefinition.WorkbookCreateProtectPermission | public | typeof WorkbookCreateProtectPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:61 |
permissionPointsDefinition.WorkbookCreateSheetPermission | public | typeof WorkbookCreateSheetPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:62 |
permissionPointsDefinition.WorkbookDeleteSheetPermission | public | typeof WorkbookDeleteSheetPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:63 |
permissionPointsDefinition.WorkbookDuplicatePermission | public | typeof WorkbookDuplicatePermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:64 |
permissionPointsDefinition.WorkbookEditablePermission | public | typeof WorkbookEditablePermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:65 |
permissionPointsDefinition.WorkbookExportPermission | public | typeof WorkbookExportPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:66 |
permissionPointsDefinition.WorkbookHideSheetPermission | public | typeof WorkbookHideSheetPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:67 |
permissionPointsDefinition.WorkbookHistoryPermission | public | typeof WorkbookHistoryPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:68 |
permissionPointsDefinition.WorkbookManageCollaboratorPermission | public | typeof WorkbookManageCollaboratorPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:69 |
permissionPointsDefinition.WorkbookMoveSheetPermission | public | typeof WorkbookMoveSheetPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:70 |
permissionPointsDefinition.WorkbookPrintPermission | public | typeof WorkbookPrintPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:71 |
permissionPointsDefinition.WorkbookRecoverHistoryPermission | public | typeof WorkbookRecoverHistoryPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:72 |
permissionPointsDefinition.WorkbookRenameSheetPermission | public | typeof WorkbookRenameSheetPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:73 |
permissionPointsDefinition.WorkbookSharePermission | public | typeof WorkbookSharePermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:74 |
permissionPointsDefinition.WorkbookViewHistoryPermission | public | typeof WorkbookViewHistoryPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:75 |
permissionPointsDefinition.WorkbookViewPermission | public | typeof WorkbookViewPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:76 |
permissionPointsDefinition.WorksheetCopyPermission | public | typeof WorksheetCopyPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:77 |
permissionPointsDefinition.WorksheetDeleteColumnPermission | public | typeof WorksheetDeleteColumnPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:79 |
permissionPointsDefinition.WorksheetDeleteProtectionPermission | public | typeof WorksheetDeleteProtectionPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:80 |
permissionPointsDefinition.WorksheetDeleteRowPermission | public | typeof WorksheetDeleteRowPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:81 |
permissionPointsDefinition.WorksheetEditExtraObjectPermission | public | typeof WorksheetEditExtraObjectPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:82 |
permissionPointsDefinition.WorksheetEditPermission | public | typeof WorksheetEditPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:83 |
permissionPointsDefinition.WorksheetFilterPermission | public | typeof WorksheetFilterPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:84 |
permissionPointsDefinition.WorksheetInsertColumnPermission | public | typeof WorksheetInsertColumnPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:85 |
permissionPointsDefinition.WorksheetInsertHyperlinkPermission | public | typeof WorksheetInsertHyperlinkPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:86 |
permissionPointsDefinition.WorksheetInsertRowPermission | public | typeof WorksheetInsertRowPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:87 |
permissionPointsDefinition.WorksheetManageCollaboratorPermission | public | typeof WorksheetManageCollaboratorPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:88 |
permissionPointsDefinition.WorksheetPivotTablePermission | public | typeof WorksheetPivotTablePermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:89 |
permissionPointsDefinition.WorksheetSelectProtectedCellsPermission | public | typeof WorksheetSelectProtectedCellsPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:90 |
permissionPointsDefinition.WorksheetSelectUnProtectedCellsPermission | public | typeof WorksheetSelectUnProtectedCellsPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:91 |
permissionPointsDefinition.WorksheetSetCellStylePermission | public | typeof WorksheetSetCellStylePermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:92 |
permissionPointsDefinition.WorksheetSetCellValuePermission | public | typeof WorksheetSetCellValuePermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:93 |
permissionPointsDefinition.WorksheetSetColumnStylePermission | public | typeof WorksheetSetColumnStylePermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:94 |
permissionPointsDefinition.WorksheetSetRowStylePermission | public | typeof WorksheetSetRowStylePermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:95 |
permissionPointsDefinition.WorksheetSortPermission | public | typeof WorksheetSortPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:96 |
permissionPointsDefinition.WorksheetViewPermission | public | typeof WorksheetViewPermission | undefined | - | submodules/univer/packages/sheets/src/services/permission/permission-point/const.ts:97 |
rangeRuleChangedAfterAuth$ | public | Observable <unknown > | undefined | - | submodules/univer/packages/sheets/src/facade/f-permission.ts:24 |
sheetRuleChangedAfterAuth$ | public | Observable <unknown > | undefined | - | submodules/univer/packages/sheets/src/facade/f-permission.ts:25 |
Methods
addRangeBaseProtection()
addRangeBaseProtection(
unitId,
subUnitId,
ranges): Promise<
| undefined
| {
permissionId: string;
ruleId: string;
}>
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:180
Adds a range protection to the worksheet.
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unique identifier of the workbook. |
subUnitId | string | The unique identifier of the worksheet. |
ranges | IRange [] | The ranges to be protected. |
Returns
Promise
<
| undefined
| {
permissionId
: string
;
ruleId
: string
;
}>
- Returns an object containing the
permissionId
andruleId
if the range protection is successfully added. If the operation fails or no result is returned, it resolves toundefined
. permissionId is used to stitch permission point ID,ruleId is used to store permission rules
addWorksheetBasePermission()
addWorksheetBasePermission(unitId, subUnitId): Promise<undefined | string>
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:74
This function is used to add a base permission for a worksheet.
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unique identifier of the workbook for which the permission is being set. |
subUnitId | string | The 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 toundefined
.
dispose()
dispose(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:109
Returns
void
Inherited from
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103
Returns
void
Inherited from
removeRangeProtection()
removeRangeProtection(
unitId,
subUnitId,
ruleIds): void
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:235
Removes the range protection from the worksheet.
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unique identifier of the workbook. |
subUnitId | string | The unique identifier of the worksheet. |
ruleIds | string [] | The rule IDs of the range protection to be removed. |
Returns
void
removeWorksheetPermission()
removeWorksheetPermission(unitId, subUnitId): void
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:108
Delete the entire table protection set for the worksheet and reset the point permissions of the worksheet to true
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unique identifier of the workbook for which the permission is being set. |
subUnitId | string | The unique identifier of the worksheet for which the permission is being set. |
Returns
void
setRangeProtectionPermissionPoint()
setRangeProtectionPermissionPoint(
unitId,
subUnitId,
permissionId,
FPointClass,
value): void
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:263
Modify the permission points of a custom area
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unique identifier of the workbook. |
subUnitId | string | The unique identifier of the worksheet within the workbook. |
permissionId | string | The unique identifier of the permission that controls access to the range. |
FPointClass | RangePermissionPointConstructor | The constructor for the range permission point class. See the permission-point documentation for more details. |
value | boolean | The new permission value to be set for the range (e.g., true for allowing access, false for restricting access). |
Returns
void
setRangeProtectionRanges()
setRangeProtectionRanges(
unitId,
subUnitId,
ruleId,
ranges): void
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:283
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
Parameter | Type | Description |
---|---|---|
unitId | string | The unique identifier of the workbook. |
subUnitId | string | The unique identifier of the worksheet within the workbook. |
ruleId | string | The ruleId of the range protection rule that is being updated. |
ranges | IRange [] | The array of new ranges to be set for the range protection rule. |
Returns
void
setWorkbookEditPermission()
setWorkbookEditPermission(unitId, value): void
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:64
This function is used to set whether the workbook can be edited
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | The unique identifier of the workbook for which the permission is being set. |
value | boolean | A value that controls whether the workbook can be edited |
Returns
void
setWorkbookPermissionPoint()
setWorkbookPermissionPoint(
unitId,
FPointClass,
value): void
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:50
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
Parameter | Type | Description |
---|---|---|
unitId | string | The unique identifier of the workbook for which the permission is being set. |
FPointClass | WorkbookPermissionPointConstructor | The constructor function for creating a permission point instance. Other point constructors can See the permission-point documentation for more details. |
value | boolean | The boolean value to determine whether the permission point is enabled or disabled. |
Returns
void
setWorksheetPermissionPoint()
setWorksheetPermissionPoint(
unitId,
subUnitId,
FPointClass,
value): Promise<undefined | string>
Defined in: submodules/univer/packages/sheets/src/facade/f-permission.ts:131
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
Parameter | Type | Description |
---|---|---|
unitId | string | The unique identifier of the workbook. |
subUnitId | string | The unique identifier of the worksheet. |
FPointClass | WorkSheetPermissionPointConstructor | The constructor for the permission point class. See the permission-point documentation for more details. |
value | boolean | The 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 toundefined
.
extend()
static extend(source): void
Defined in: submodules/univer/packages/core/src/facade/f-base.ts:26
Parameters
Parameter | Type |
---|---|
source | any |
Returns
void