Define roles in Custom App

kavitha_cr
Mega Guru

Hi All,

 

Requirement: I have created a new custom app called "PeopleNow" and created a new table called "GB Case" which is extended from Task table and created few record producers using this table.

Here, there are three categories of users who use this application. 

1. Requesters(who raise the GB Cases using the Record producer. Also, here - Person A should not be able to see the Person B or other requests or GB Cases)

2. Fulfiller(whom the GB Cases gets assigned to)

3.Admin(Developer)

 

Can anyone guide me how can the above roles be managed efficiently in the custom app and the custom table.

 

Thanks & Regards,

Siva Jyothi.

 

1 ACCEPTED SOLUTION

@kavitha_cr Please check if there is already a * ACL present on the table. which is blocking access to the fields. If yes then you also create * ACLs same as we created table.None ACLs

 

And you must add the below script in CREATE/READ/WRITE ACL

 

answer = (gs.getUserID() == current.<REQUESTED FOR FIELD NAME HERE>.toString()) || (gs.getUserID() == current.<ASSIGNED FIELD NAME HERE>.toString()) || (gs.getUserName() == current.sys_created_by.toString());
 
Please mark as correct answer if this solves your issue.
Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

View solution in original post

6 REPLIES 6

Hi @jaheerhattiwale ,

 

There are no * ACL's on this table and there are 4 ACL's (None) create, read, write, delete

I have deactivated the delete ACL as the user shouldn't be able to do.

For the other 3 ACL's I have added the given code, but still Create new button is not visible on the table level.

The ACL's are below.

SivaJyothi1_3-1670840570648.png

 

SivaJyothi1_1-1670840491387.pngSivaJyothi1_2-1670840510965.png

SivaJyothi1_4-1670840604596.png

When given the user role to an employee, no records are displaying and even the employee is unable to see the record assigned to him.

SivaJyothi1_5-1670840691045.png

Could you please check if anything needs to be corrected.

 

Thanks,

Siva.

 

@kavitha_cr You shot not deactivate the delete acl, that will give everyone access to delete. You can add answer=false in script to avoid deletion.

 

And if you have added correct role and script in create/read/write acl then log out and log back in to check.

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023