ACL for for restricting user to create records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2020 05:18 AM
Hello,
I need to create an ACL so that user is not able to create any new records except for rest/Soap users , but all the users should be able to edit the records as per there roles .
Will it be possible?
- Labels:
-
User Experience and Design

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2020 05:53 AM
Hi,
I will suggest to do it based on roles.
So if the user has soap or rest role then allow always and if the ticket is opened then allow to write to it and if active is false dont allow.
So i will write a acl script as below:
var flag = false;
var actFlag = false;
if(gs.hasRole('soap,rest')){
flag = true;
}
else{
flag = false;
}
if(current.active==true && !current.isNewRecord())
actFlag = true;
else
actFlag = false;
if(flag == true || actFlag == true)
answer=true;
else
answer=false;
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2020 07:54 AM
Hi Deepansh,
In that case I would suggest this approach
1) Create a group "SOAP/REST Users"
2) Add the soap or rest users which you are using for integration to this above group
3) Now use the group membership in the ACL
The above solution will be scalable in the terms i.e. in future if soap user is not used you can remove that user from the group and no need to update anything in ACL script
answer = gs.getUser().isMemberOf('SOAP/REST Users');
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader