FeatureFuel
1

Simpler way to get a user's policies needed

Source: directus/directus#24691 · opened by @stx-chris
Describe the Bug Although technically not a bug, using policies in actual application turns into a cumbersome endeavour. It ought to easy to get the names of all policies assigned to a user, including the ones attached to their role. (Using policy ids instead of names in an app is not a practical approach) If I want to know which policies a user belongs to, I have to execute the following steps: 1. Set up a policy and add Read permission to at least directus_access, directus_policies,directus_users 2. Restrict access to these tables to the user and the user's role respectively 3. Retrieve the user's record including the filters policy.policies.name, role.policies.policy.name to get the actual policy names 4. Merge the policy names from their different levels in the returning user object into a single array to be usable for lookups within an application Can we have a helper function within the SDK, maybe getUserPolicies(user) that returns an array of all policies a…

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests