Users (collaboration-core)
@ckeditor/ckeditor5-collaboration-core/src/users
class
The Users
plugin provides the basic interface for setting and getting users involved in the document editing process.
Filtering
Properties
-
A reference to the currently connected user or
null
if it has not been set. -
users : Collection
readonly
An iterable list of all users added to the editor.
for ( const user of editor.plugins.get( 'Users' ).users ) { console.log( user.name ); }
Use
addUser
to add a new user.
Methods
-
-
Adds a new user to the list of users.
-
defineMe( userId )
Sets the user with the given ID as
me
.Parameters
userId : String
-
getOperationAuthor( operation ) → User
-
Returns the user with a given ID.
-
Sets an anonymous user as
me
.The user's ID will be set to the value of
config.users.anonymousUserId
property.