GetAllUsers

function GetAllUsers(): ApiProtectedRangeUserInfo[] | "null"

Description

Returns all users from the current protected range.

Returns

ApiProtectedRangeUserInfo[] | "null"

Try It

var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A1").SetValue("1");
oWorksheet.GetRange("B1").SetValue("2");
oWorksheet.GetRange("C1").SetValue("3");
oWorksheet.AddProtectedRange("Protected range", "$A$1:$C$1");
var oProtectedRange = oWorksheet.GetProtectedRange("Protected range");
oProtectedRange.AddUser("uid-1", "John Smith", "CanEdit");
oProtectedRange.AddUser("uid-2", "Mark Potato", "CanView");
var aUsers = oProtectedRange.GetAllUsers();
oWorksheet.GetRange("A3").SetValue(aUsers[0].GetName());

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).