Name

global.SidebarChatUserUtilSNC

Description

No description available

Script

var SidebarChatUserUtilSNC = Class.create();
SidebarChatUserUtilSNC.prototype = {
  initialize: function() {},

  checkForPermission: function(userSysId, recordSysId, table) {
      var hasPermission = false;
      if (!userSysId || !recordSysId || !table)
          return false;
      var myUser = gs.getSession().impersonate(userSysId);
      var gr = new GlideRecordSecure(table);
      gr.addQuery('sys_id', recordSysId);
      gr.query();
      if (gr.next() && gr.canRead())
          hasPermission = true;
      gs.getSession().impersonate(myUser);

      return hasPermission;
  },

  type: 'SidebarChatUserUtilSNC'
};

Sys ID

4306917253c62110ad0fddeeff7b12ba

Offical Documentation

Official Docs: