Summary of Features
By default, all permissions verification for the interactive whiteboard is disabled, meaning all users have the ability to operate the interactive whiteboard. If you need to restrict user permissions in your business scenario, you can refer to this document for user operational permissions control.
Version Support
iOS | Android | Windows | Mac OS | Web | WeChat Mini Program |
2.8.0.170+ | 2.8.0.216+ | 2.8.0.317+ | 2.8.0.154+ | 2.8.0+ | 2.8.0+ |
User Guide
The interactive whiteboard provides two types of permissions control, including basic permissions control and advanced permissions control. See the following description for details.
Basic Permissions Control
Basic permissions are a set of built-in permissions control for the interactive whiteboard, implemented through the initialization parameters drawEnable and setDrawEnable interfaces, mainly including the following permissions:
Permission Name | Description |
Element::Add::* | Adding Element Permissions, such as pen tool, geometric shape tool, and calling the addElement interface |
Element::Delete::* | Deleting Element Permissions |
Element::Select::* | Selecting Element Permissions |
Element::Move::* | Moving Element Permissions |
Element::Update::* | Updating Element Permissions, such as changing element color, size, etc. |
Element::Scale::* | Scaling Element Permissions |
Element::Rotate::* | Rotating Element Permissions |
Background::Update::* | Updating Background Image Permissions |
Board::Switch::* | Turning Pages Whiteboard Permissions |
Board::Clear::* | Permission to clear whiteboard elements, corresponding to the clear interface |
File::Clear::* | Permission to clear elements within a file, corresponding to the clearFileDraws interface |
If users are not allowed to operate the whiteboard, set drawEnable to false in the initialization parameters or call setDrawEnable(false). If user A needs permission to operate the whiteboard during use, user A can call setDrawEnable(true).
If you want to understand the implementation principle of drawEnable, please read Advanced Permission Control first, then refer to Appendix 1: Implementation Principle of drawEnable.
Advanced permission control
If base permission control does not meet your business needs and more precise control is required, use the advanced permission control interface.
By default, users have all whiteboard operational permissions. To restrict a specific operation, enable the corresponding interface for permission verification.
Enabling whiteboard operational permission verification
1. This interface is only effective for local settings.
2. Calling this interface enables verification for the corresponding permission. Only after passing the verification can the corresponding whiteboard operation be executed.
Parameter Name | Type | Description |
permissions | Array.<string> | Permission list, supports wildcard *, see currently supported permissions |
filters | Array.<string> | Condition list, supports wildcard *, see currently supported conditions |
Example 1:
In the room, there is teacher T and student A. Grant T operational permissions for files, whiteboards, and elements, and disable all permissions for A.
teduBoard.enablePermissionChecker(['File::*::*', 'Board::*::*', 'Element::*::*'], ['operator/T']); // Both T and A call this.Explanation:
When teacher T adds courseware ('File::*::*'), permission validation will be performed according to the configuration. The corresponding operational permissions are only for user T ('operator/T). At this time, the user adding the courseware is T, and the permission configuration allows T to add it, so the permission validation passes, and T can add the courseware normally.
When student A adds courseware ('File::*::*'), permission validation will be performed according to the configuration. The corresponding operational permissions are only for user T ('operator/T). At this time, the user adding the courseware is A, but the permission configuration only allows T to add it, so the permission validation fails, and A cannot add the courseware, triggering the TEB_BOARD_PERMISSION_DENIED event for no operational permissions.
Disabling permission validation for operating the whiteboard
1. This interface is only effective for local settings.
2. When calling this interface, the corresponding permission settings will not be validated, permissions will be restored to default, and the caller will obtain the corresponding operational permissions.
Parameter Name | Type | Description |
permissions | Array.<string> | Permission list, supports wildcard *, see currently supported permissions |
Example 2:
Continuing from Example 1: Student A currently does not have permissions to add courseware, whiteboards, or elements (such as pens, lines, etc.).
If it is necessary to allow student A to use the pen feature, student A can call the teduBoard.disablePermissionChecker(['Element::*::*']) interface to disable validation for element operations.
Explanation:
Disabling the permission check for element operations means that permissions are not checked when operating on elements. Not checking permissions implies default permission to operate on elements, allowing Student A to use the brush.
If Student A needs to add courseware, they can call the teduBoard.disablePermissionChecker(['File::*::*']) interface to disable the permission check for file operations.
Explanation:
Disabling the permission check for file operations means that permissions are not checked when operating on files. Not checking permissions implies default permission to operate on files, allowing Student A to manage files.
Permission Change Event
Calling the enablePermissionChecker and disablePermissionChecker interfaces will trigger this event.
// Web SampleteduBoard.on(TEduBoard.EVENT.TEB_BOARD_PERMISSION_CHANGED, (permissions, filters) => {});
No Operation Permission Event
This event is triggered when a user attempts to operate on the whiteboard without the necessary permissions.
// Web SampleteduBoard.on(TEduBoard.EVENT.TEB_BOARD_PERMISSION_DENIED, (permission) => {});
Permission List
API Name | Permission Name | Description |
setGlobalBackgroundColor | Background::Update::Color | Set Global Background Color |
setBackgroundColor | Background::Update::Color | Set Single Page Whiteboard Background Color |
setGlobalBackgroundPic | Background::Update::Image | Set Global Background Image |
clear | Board::Clear | Clear Whiteboard |
setBackgroundImage | Background::Update::Image | Set Single Page Whiteboard Background Image |
setBackgroundH5 | Background::Update::Frame | Set single-page whiteboard background H5 |
undo | Board::Undo::* | Undo |
redo | Board::Redo::* | Resolved |
addBoard | Board::Add | Add Whiteboard |
deleteBoard | Board::Delete | Delete Whiteboard |
prevStep | Board::Switch::Step | Back |
nextStep | Board::Switch::Step | Next |
prevBoard | Board::Switch::Page | Previous Page |
nextBoard | Board::Switch::Page | Next Page |
gotoBoard | Board::Switch::Page | Page Turning |
setBoardRatio | Board::Update::Ratio | Set Whiteboard Proportion |
setBoardScale | Board::Scale::* | Set Whiteboard Scaling |
gotoStep | Board::Switch::Step | Jump Animation Steps |
setBoardContentFitMode | Board::Update::ContentFitMode | Set Whiteboard Padding Method |
addTranscodeFile | File::Add | Add Transcoding Courseware |
addImagesFile | File::Add | Add Image Group Courseware |
deleteFile | File::Delete | Delete Courseware |
switchFile | File::Switch | Switch Courseware |
clearFileDraws | File::Clear | Clear Doodling on File |
addVideoFile | File::Add | Add Video Courseware |
playVideo | File::Update::Video | Play Video Courseware |
pauseVideo | File::Update::Video | Suspend Video Courseware |
seekVideo | File::Update::Video | Adjust Video Courseware Progress |
muteVideo | File::Update::Video | Mute Video Courseware |
resetVideoProgress | File::Update::Video | Reset video courseware progress |
playAudio | File::Update::Audio | Play audio element |
pauseAudio | File::Update::Audio | Pause audio element |
seekAudio | File::Update::Audio | Adjust audio element progress |
muteAudio | File::Update::Audio | Mute audio element |
setAudioVolume | File::Update::Audio | Set audio element volume |
setFileScale | File::Update::Scale | Scaling file |
addH5File | File::Add | Add H5 file |
removeElement | Element::Delete | Delete element |
addElement | Element::Add | Add element, including using brush tool, geometric tool, calling addElement API, etc. |
setTextValue | Element::Update | Set text element content |
useMathTool | Element::Add::MathTool | Using math educational tools |
updateElementById | Element::Update | Update element position, size, color, etc. |
Condition List
Condition Name | Type | Description |
operator | string | Operator |
creator | string | Creator |
// Example 1: Allow operators userId T, A, B['operator/T,A,B'] // Configure named userId// Example 2: Allow all operators['operator/*'] // Configure wildcard// Example 3: Prohibit all operations['operator/'] // If userId is not configured, it means no one matches// Example 4: Allow operations on files or elements added by users A and B['creator/A,B']// Example 5: Allow operations on files or elements added by all creators['creator/*']
Use Case
### Scenario 1In the room, there is teacher T and student A. Grant T permissions to operate files, whiteboard, and elements, and disable all permissions for A./** T/A call */enablePermissionChecker(['File::*::*', 'Board::*::*', 'Element::*::*'], ['operator/T']);### Scenario 2The room contains Teacher T, Student A, and Student B. TAB are all granted element operation permissions./** Method 1 */// All three are setenablePermissionChecker(['Element::*::*'], ['operator/A,B,T']);/** Method 2 */// T callsenablePermissionChecker(['Element::*::*'], ['operator/T']);// A callsenablePermissionChecker(['Element::*::*'], ['operator/A']);// B callsenablePermissionChecker(['Element::*::*'], ['operator/B']);### Scenario 3The room contains Teacher T, Student A, and Student B. T can delete (including calling the removeElement interface, eraser, and keyboard del key) elements created by anyone (T, A, B), A can only delete elements created by A, and cannot delete elements created by others, B cannot delete any elements.// T callsenablePermissionChecker(['Element::Delete::*'], ['creator/*']);// A callsenablePermissionChecker(['Element::Delete::*'], ['creator/A']);// B callsenablePermissionChecker(['Element::Delete::*'], ['creator/']);### Scenario 4The room contains Student A, Student B, and Student C. Only A is allowed to delete elements created by A and B, and cannot delete elements created by C.// Users A, B, and C are set up as followsenablePermissionChecker(['Element::Delete::*'], ['operator/A', 'creator/A,B']);### Scenario 5In the room, there are Teacher T, Student A, and Student B. T can only operate elements created by B.// T callsenablePermissionChecker(['Element::*::*'], ['creator/B']);### Scenario 6Disable all operations for the current user// Called by all usersenablePermissionChecker(['*::*::*'], ['operator/']);// 'operator/' indicates that for the operator condition, the matching value is empty, meaning no operator is allowed to pass this permission check### Scenario 7Enable all operations for the current user// Called by all usersenablePermissionChecker(['*::*::*'], ['operator/*']);// 'operator/*' indicates that for the operator condition, the matching value is any, meaning all operators are allowed to pass this permission check### Scenario 8In the room, there is Student A. Student A is allowed to jump animation steps but cannot turn pages.// A callsenablePermissionChecker(['Board::Switch::Step'], ['operator/A']);// A callsenablePermissionChecker(['Board::Switch::Page'], ['operator/']);### Scenario 8In the room, there is Student A. Student A is not allowed to operate the compass tool, only to view.// A callsenablePermissionChecker(['Element::Update::MathTool'], ['operator/']);
Appendix 1: Implementation Principle of drawEnable
Initialization parameters drawEnable and interface setDrawEnable include the following permissions:
'Element::Add::*','Element::Delete::*','Element::Move::*','Element::Select::*','Element::Update::*','Element::Scale::*','Element::Rotate::*','Background::Update::*','Board::Switch::*','Board::Clear::*','File::Clear::*'
When user A sets drawEnable to true, it is equivalent to executing the following permission configuration:
const permissions = ['Element::Add::*','Element::Delete::*','Element::Move::*','Element::Select::*','Element::Update::*','Element::Scale::*','Element::Rotate::*','Background::Update::*','Board::Switch::*', 'Board::Clear::*','File::Clear::*'];teduBoard.enablePermissionChecker(permissions, ['operator/A', 'creator/A']); // User A has the above operation permissions
When user A sets drawEnable to false, it is equivalent to executing the following permission configuration:
const permissions = ['Element::Add::*','Element::Delete::*','Element::Move::*','Element::Select::*','Element::Update::*','Element::Scale::*','Element::Rotate::*','Background::Update::*','Board::Switch::*', 'Board::Clear::*','File::Clear::*'];teduBoard.enablePermissionChecker(permissions, ['operator/', 'creator/']); // No user has the above permissions