GetUser

function GetUser(sId: string = null): ApiProtectedRangeUserInfo | "null"

Description

Returns an object that represents a user from the current protected range.

Parameters

sIdstringdefault: null

The user ID.

Returns

ApiProtectedRangeUserInfo | "null"

Try It

var oWorksheet = Api.GetActiveSheet();
oWorksheet.AddProtectedRange("protectedRange", "$A$1:$B$1").AddUser("userId", "name", "CanView");
var protectedRange = oWorksheet.GetProtectedRange("protectedRange");
var userInfo = protectedRange.GetUser("userId");
var userName = userInfo.GetName();
oWorksheet.GetRange("A3").SetValue("User name: " + userName);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).