User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification prefernces

Ajay Sharma2
Tera Guru

User is not able to create new notification channel from table(cmn_notif_device) however he is able to create channel from system settings using notification preferences.

I don't want to change OOB ACLs for this. Could anyone help how notification preferences are created or accessed via system settings--> notification prefrences

9 REPLIES 9

shloke04
Kilo Patron

Hi,

I don't think that code will be exposed to us how it is being displayed in Gear settings.

But yes, reason why user are not able to create new record in cmn_notif_device table is because of an OOB ACL which check if current logged in user is same as the value present in User field or not and also for New Records with help of below condition:

current.isNewRecord() || current.user == gs.getUserID()

Link for the ACL below:

https://instance.service-now.com/nav_to.do?uri=sys_security_acl.do?sys_id=7e0faa45c0a80166608da235042e06a0


Replace "instance' with your instance name.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hi @shloke4 I am using the same user while trying to create new record. I can't see new button while accessing the table but if I use sys_id as -1 in query parameter i can create new records using the end user. Issue is only with those user who are having only snc_internal role.

Hi @Ajay Sharma 

It is bit confusing the way it's been designed OOB. There are two things here which need to be mention to make you understand:

1) User logged in to System has access or not to create record in Notification Device Table.

2) Visibility of New button on the same Table.

Let me explain as below:

1) As mentioned before as well there is a ACL which check to allow user to create record only when the User field on "Notification Device " table is same as current logged in user or not. This is checked in ACL which I have shared above.

Now when you modify the query and directly try to create a New record by having sys_id = -1, On Notification Device Table ServiceNow set the current logged in User as a Default value on the User field which satisfy the ACL script and hence you are able to create record when you give sys_id=-1.

find_real_file.png

This default value is set as shown below in the dictionary of User field:

 

find_real_file.png

Now coming to the New button visibility, that looks like a button on the Global Table itself which might be possible that user might not have access to View that button.

I have verified that there is no such button on Notification Device Table. So what you can do is create a New button on Notification Device table and that should solve your issue and resolve this confusion as well. The issue is not with the ACL as any user on the platform can create Notification Channel

UI Action Script:

var url = '/cmn_notif_device.do?sys_id=-1&sys_is_list=true&sys_target=cmn_notif_device&sysparm_checked_items=&sysparm_fixed_query=&sysparm_group_sort=&sysparm_list_css=&sysparm_query=&sysparm_referring_url=cmn_notif_device_list.do&sysparm_target=&sysparm_view=';
action.setRedirectURL(url);

find_real_file.png

What this UI Action will do is override the current New Button and end user will now be able to create Channel as you want.

This is working for me in my PDI.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hi @shloke04 ,

 

Thanks for the reply. But this is not about creating new UI Action. The actual problem I want to solve here is I have created "Notification preferences" widget as per this link

"https://community.servicenow.com/community?id=community_article&sys_id=dad9ccd9db03af00d6a102d5ca961975"

 

Now if user clicks on "Create Channel" link  I get error like "Record not found".

But user is able to read/edit previously created channels/device.

find_real_file.png

find_real_file.png