Gribben
09/30/2025, 3:39 PMconst rolesWithAccess = await lookupSubjects(companyId, {
permission: "allow_access",
resource: {
type: "feature",
id: feature,
},
subjectObjectType: "role",
optionalSubjectRelation: "member",
});
const userIdsWithAccess = await lookupSubjects(companyId, {
permission: "allow_access",
resource: {
type: "feature",
id: feature,
},
subjectObjectType: "user",
});
Schema:
/** give access to a specific user or role group */
relation allow_access: role#member | user
It first of all returns a list with the same role elements, which I guess is because multiple users have that role (This is not a big issue but perhaps is an indicator that I'm doing something wrong?).
Secondly, even though I have not populated allow_access with any users it returns the users that have the roles which have access to the feature.
I ultimately just wanted to figure out why the user has access, either by it's role or if the specific user has been granted access.
Thanks in advance 🙂Joey
09/30/2025, 3:43 PMJoey
09/30/2025, 3:44 PMrole#member as wellGribben
09/30/2025, 3:46 PMJoey
09/30/2025, 3:48 PMJoey
09/30/2025, 3:48 PMJoey
09/30/2025, 3:48 PMJoey
09/30/2025, 3:48 PMJoey
09/30/2025, 3:48 PMJoey
09/30/2025, 3:48 PMGribben
09/30/2025, 3:49 PMJoey
09/30/2025, 3:49 PM