ACL Based Question

AkashKushwah
Tera Contributor

Hi , I am learning ACL in ServiceNow and I have some use cases related to ACL. So can anyone help me to solve below use cases ?

How will you restrict a student so they can only view their own student record and not others? 

How can you ensure that only teachers and admins can view or download attachments (like report cards) uploaded to student records? 

 

Thank You

Akash 

1 ACCEPTED SOLUTION

Prinssi
Mega Sage

Hi @AkashKushwah ,

 

I might need a little more information about the tables you are using, how you classify the users, and whether there is a relationship between the students and the teachers (i.e. is there a field on a student record, or some other many-to-many table that connects students with individual teachers).

 

For the first use case, you would create a read ACL using the condition builder to the following:

  • Student (is dynamic) "Me"

This is assuming that you have a user field on the record that corresponds to the student. This would allow each student to see their own record, but not other students' records.

 

For the second use case, do the teachers and admins have a unique role? Or is there a way to identify them on the user record?

Assuming there is a role for "teacher" and another role for "admin", you would create a new read ACL and add the two roles to the ACL (a user only needs to have one of the listed roles to satisfy the ACL).

View solution in original post

1 REPLY 1

Prinssi
Mega Sage

Hi @AkashKushwah ,

 

I might need a little more information about the tables you are using, how you classify the users, and whether there is a relationship between the students and the teachers (i.e. is there a field on a student record, or some other many-to-many table that connects students with individual teachers).

 

For the first use case, you would create a read ACL using the condition builder to the following:

  • Student (is dynamic) "Me"

This is assuming that you have a user field on the record that corresponds to the student. This would allow each student to see their own record, but not other students' records.

 

For the second use case, do the teachers and admins have a unique role? Or is there a way to identify them on the user record?

Assuming there is a role for "teacher" and another role for "admin", you would create a new read ACL and add the two roles to the ACL (a user only needs to have one of the listed roles to satisfy the ACL).