"Action not Authorized" info message when click UI Action

Dinh Nguyen
Kilo Sage

Hi everyone,

I have an issue displaying the info message "Action not Authorized" when clicking an UI Action.

I have researched and tried the following solutions as below, but they didn't work:

  • Change action name of UI Action
  • Change Condition to call Script Include

The account I use has the admin role and I have checked the ACLs. But it still doesn't work, does anyone have any other solution to check, please help me.

Thank you so much.

 

1 ACCEPTED SOLUTION

Daniel Borkowi1
Mega Sage

Hi @Dinh Nguyen  see my last reply on https://www.servicenow.com/community/developer-forum/quot-action-not-authorized-quot-info-message-wh...

 

 

Greets
Daniel

Please mark reply as Helpful/Correct, if applicable. Thanks!

View solution in original post

14 REPLIES 14

Hi @Daniel Borkowi1 , 

I have checked the information you mentioned, but UI Action and Script Include both do not have set access. So it's not the cause of my error.

Hi @Dinh Nguyen can you post your condition and your script within UI Action? Maybe a Screenshot?

 

 

Hi @Daniel Borkowi1,

I can't take a screenshot due to security. But I can present the handler like below:

My condition:

current.state == 'storage_failure' || (current.contracttype== '1' && current.state == 'published') || current.state == 'completed'

 

Script:

function runClientSideCode() {
var checkAttachment, storeFunc;

if (isCheck()) {
checkAttachment = 'checkAttachmentForA';
storeFunc = 'storeA';
} else {
checkAttachment = 'checkAttachmentForB';
storeFunc = 'storeB';
}

function (isCheck() {
var val1 = g_form.getValue("value_1");
var val2 = g_form.getValue("value_2");

if ((val1 == '' && val2 == '') || val1 == 'P' && val2 == 'PY')) {
return false;
}
return true;
}

var ga = new GlideAjax('checkAttachment');
ga.addParam('sysparm_name', checkAttachment);
ga.addParam('sys_id', g_form.getUniqueValue());
ga.getXML(callBack);

function callBack(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer == 'true') {
var confirm = confirm('Call Sub-Flow ?');

if (confirm) {
ga = new GlideAjax('call_Subflow');
ga.addParam('sysparm_name', storeFunc);
ga.addParam('sys_id', g_form.getUniqueValue());
ga.getXML();
}
gsftSubmit(null, g_form.getFormElement(), 'ui_action_storage');
} else if (answer == 'false') {
alert("Error");
} else {
answer = JSON.parse(answer);
answer.forEach(function(element) {
alert(element);
});
}
}

}

if (typeof window == 'undefined') {
runServerSideCode();
}

function runServerSideCode() {
current.update();
action.setRedirectURL(current);
}

 

 

Hi @Dinh Nguyen , I'm quite sure, that this error message has an ACL as Root Cause.

I know you already checked the ACLs but maybe something has been overlooked. 

I would recommend:

  1. Remove condition and test --> if the error Message is not occuring, than please check each field ACL in your condition has Admin overrrides true or includes admin role
  2. Add condition again
  3. Check Script Include: checkAttachment if there is an ACL related which gives your user access to (Type: client_callable_script_include, Operation: execute, Decision Type: Allow if, Name: checkAttachment)
  4. Check Script Include: call_Subflow if there is an ACL related which gives your user access to (Type: client_callable_script_include, Operation: execute, Decision Type: Allow if, Name: call_Subflow)
  5. If still no Finding: check if one of the Script Include uses GlideRecordSecure instead of GlideRecord --> in this case check the Table ACLs for which GlideRecordSecure is used.

Greets
Daniel

Please mark reply as Helpful/Correct, if applicable. Thanks!

Hi @Daniel Borkowi1 ,

Thanks for helping me.

I have discovered a phenomenon that causes the message "Action Not Authorized" to display. I have presented it specifically in this post. Can you please check this post:

https://www.servicenow.com/community/developer-forum/quot-action-not-authorized-quot-info-message-wh...