Name

global.AJAXAddScopes

Description

No description available

Script

var AJAXAddScopes = Class.create();
AJAXAddScopes.prototype = Object.extendsObject(AbstractAjaxProcessor, {
  addScopes:function() {
  	var entity = new GlideRecord('oauth_entity');
  	if (entity.canCreate()) {
  		var builder = new SNC.OAuthEntityBuilder(entity);
  		builder.addAllScopesToEntityProfile(this.getParameter('sysparm_oauthEntityId'));
  	} else {
  		gs.error("Access denied. Unable to add all scopes to profile.");
  	}
  },
  updateScopes:function() {
  	var entity = new GlideRecord('oauth_entity');
  	if (entity.canCreate()) {
  		var builder = new SNC.OAuthEntityBuilder(entity);
  		builder.updateScopes(this.getParameter('sysparm_scopes'), this.getParameter('sysparm_oauthEntityId'));
  	} else {
  		gs.error("Access denied. Unable to add update scopes.");
  	}
  }
});

Sys ID

3d2a991a53033300a91ccd2323dc3467

Offical Documentation

Official Docs: