Is there a way to set a date for a Group Permission to expire on a user account?

Lori1
Tera Expert

 

 

 

 

 

 

 

I assign group permissions to individuals, but often those permissions are meant to be temporary. I would like to be able to automatically set a date, where the group is removed from the user's profile so that their advanced access is revoked. So, for instance, a user is temporarily filling in on a support role until the end of the year, I assign them the associated permission group, and then on Dec 31 at 11:59pm I want the system to remove that group.  Does that functionality exist?

5 REPLIES 5

ersureshbe
Giga Sage
Giga Sage

Hi, There is no OOB functionality. But you can customize.

1. Create a end date in sys_user table.

2. Based on the current date and end date you should write the schedule job on daily basis.

3. If currentdate is greater than end date it should refer the 'sys_user_has_role' table and delete the relationship

Regards,
Suresh.

This makes sense, thanks. I do not however, have much experience being new to this on the coding side of this. Is there a similar example you can share?

Hi, You can use below link to achieve. Additionally you should add the date validation in that script and finally execute it.

https://www.servicenow.com/community/now-platform-forum/script-to-delete-roles-from-user-roles/m-p/1...

 

Regards,
Suresh.

Musab Rasheed
Tera Sage

Hello,

Yes, you can easily do this with Scheduled job, you can gliderecord User table, get when to revoke information then gliderecord group table and delete group accordingly, you can run job daily.

Please hit like and mark my response as correct if that helps
Regards,
Musab