Skip to content

Object Record Roles Relationship

Use the roles__sysr relationship to retrieve role assignments created through manual assignment, Custom Sharing Rules, Matching Sharing Rules, and Child Security. This relationship is available on Vault object targets with roles enabled.

When querying objects configured with dynamic role assignments, such as Tree Security, the relationship returns supported static data like Custom or Matching Sharing Rules. Due to record visibility rules, it does not include information derived from the dynamic role assignments.

The roles__sysr inbound relationship cannot be queried directly and is only available as a subquery.

NameDescription
user__sysrA child relationship allowing a join with the user__sys object.
group__sysrA child relationship allowing a join with the group__sys object.
Field NameDescription
role_name__sysThe name of the role. For example, reviewer__v.
user__sysThe ID of the user in the role.
group__sysThe ID of the group in the role.
object_record_id__sysThe object record ID.
object_name__sysThe Vault object name. For example, country__v.
assignment_type__sysIndicates how the role was assigned. Valid picklist values include: manual_assignment__sys, custom_sharing_rule__sys, matching_sharing_rule__sys.

The following query retrieves the ID and name of a specific Product record, and uses a subquery to retrieve each role assignment's name, assigned user, and assignment type for that record.

SELECT id, name__v,
  (SELECT role_name__sys, user__sys, assignment_type__sys FROM roles__sysr)
FROM product__v
WHERE id = 'V0B000000003009'