FBaseObjectPermission
Command-backed Edit permission for one stable Base object.
Access
Access through:
FBaseDashboard.getPermission()FBasePivotView.getPermission()FBaseTableRecord.getPermission()FBaseTableField.getPermission()FBaseTable.getPermission()FBaseTableView.getPermission()
Setup
Register @univerjs-pro/bases or a preset that includes it. In plugin mode, import @univerjs-pro/bases/facade. Additional methods below require their listed plugin packages. See Facade setup.
@univerjs-pro/bases
FBaseObjectPermission.canEdit
Returns the effective Edit result after applying the Base unit, parent objects, and this object.
canEdit(): booleanReturns
Whether the object is currently editable.
Package: @univerjs-pro/bases · Type definitions
FBaseObjectPermission.setEditable
Enables or disables editing for this stable Base object.
This changes only the object's Edit point. canEdit() also applies the Base unit and parent
object ceilings, so enabling a child does not override a read-only Base or parent Table.
setEditable(editable?: boolean): Promise<void>Parameters
editable— Optional. Default:true. Whether object editing is allowed. Defaults to true.
Returns
Resolves after the permission command finishes.
Examples
Restore editing for a table
const base = univerAPI.getActiveBase()const table = base?.getTables()[0]if (!table) throw new Error('Tasks table not found.')await table.getPermission().setEditable()Types: Promise
Package: @univerjs-pro/bases · Type definitions
FBaseObjectPermission.setReadOnly
Makes this stable Base object read-only.
setReadOnly(): Promise<void>Returns
Resolves after the permission command finishes.
Examples
const table = univerAPI.getActiveBase()?.getTables()[0]if (!table) throw new Error('Table not found.')await table.getPermission().setReadOnly()Types: Promise
Package: @univerjs-pro/bases · Type definitions
How is this guide?