- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 05:40 AM
Hi,
I found out that HR agents must have the sn_hr_le.activity_writer role if they want to access and edit HR templates. I found an ACL in the HR Core scope that says that if a user has the above role and the owning group field is not empty, they are able to edit HR templates.
I'm wondering about is that this role comes from the LE scope, and I don't see a similar role in the HR Core scope.
What do you think? Is it the right way to give HR agents the sn_hr_le.activity_writer role to edit hr templates or should I consider another approach?
ACL
canEditTemplate function
canEditTemplate: function(template) {
var roles = new hr_Utils();
// if a life cycle admin, can edit regardless of owning group
var isHrAdmin = roles.checkUserHasRole('sn_hr_core.admin');
if (isHrAdmin)
return true;
// if not an activity writer, then cannot edit, regardless of owning group
var isActivityWriter = roles.checkUserHasRole('sn_hr_le.activity_writer');
if (!isActivityWriter)
return false;
// has activity writer, but must be in group too
if (template.owning_group) {
var grGroups = new GlideRecord('sys_user_grmember');
grGroups.addQuery('user', gs.getUserID());
grGroups.addQuery('group', template.getValue('owning_group'));
grGroups.query();
var isMemberOf = grGroups.next();
return isMemberOf;
}
return template.isNewRecord();
},
Manage HR Template module - when users have above role, they can see this module
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 06:39 AM
Yes, the user need to have this role.
Not necessary to assign this role to that group. if user inherit this particular role from nay other group then users can edit HR Template. You can add this role to Owned By group to allow all users in that group to be able to edit HR templates.
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 09:33 AM
Hello @miro2 ,
As per OOB configuration users with 'sn_hr_core.admin' can edit HR Templates. I can see two modules on my PDI and that is accessible to 'sn_hr_core.admin'.
As you know Lifecycle Events is separate plugin and not mandatory. However they introduced additional role as part of Lifecycle Event application enabled managing HR Templates for this new role.
So the module under Lifecycle event is accessible to users having role "sn_hr_le.activity_writer" if Lifecycle Event is installed. Otherwise only HR admin (sn_hr_core.admin) can manager HR templates.
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 07:05 AM
Yes, thats what I mean.
Add the role to group you already created.
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 07:40 AM
@Anil Lande
Do you know why sn_hr_le.activity_writer is in the LE scope?
Even the 'Manage HR Template' module is under LE. Why it's not under HR Administration module.
And can I used it in HR Core scope, with having any conflicts?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2024 09:33 AM
Hello @miro2 ,
As per OOB configuration users with 'sn_hr_core.admin' can edit HR Templates. I can see two modules on my PDI and that is accessible to 'sn_hr_core.admin'.
As you know Lifecycle Events is separate plugin and not mandatory. However they introduced additional role as part of Lifecycle Event application enabled managing HR Templates for this new role.
So the module under Lifecycle event is accessible to users having role "sn_hr_le.activity_writer" if Lifecycle Event is installed. Otherwise only HR admin (sn_hr_core.admin) can manager HR templates.
Thanks
Anil Lande