<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[I want to allow every user with a role to be granted access to all entities of a given type]]></title><description><![CDATA[<p dir="auto">Say I have a large number of entities called Equipment. I have an application with a role "Viewer". I want all users with that role to be granted access to all Equipment entities.</p>
<p dir="auto">How can I do this?</p>
]]></description><link>https://fusionauth.io/community/forum/topic/1448/i-want-to-allow-every-user-with-a-role-to-be-granted-access-to-all-entities-of-a-given-type</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 16:05:25 GMT</lastBuildDate><atom:link href="https://fusionauth.io/community/forum/topic/1448.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Jan 2022 16:28:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I want to allow every user with a role to be granted access to all entities of a given type on Tue, 04 Jan 2022 16:32:30 GMT]]></title><description><![CDATA[<p dir="auto">I'd use a webhook to provision/deprovision the grants.</p>
<p dir="auto"><a href="https://fusionauth.io/docs/v1/tech/events-webhooks/events/user-registration-create-complete/" rel="nofollow ugc">https://fusionauth.io/docs/v1/tech/events-webhooks/events/user-registration-create-complete/</a> has the roles for the application, so in the webhook, you can call the FusionAuth  grant API to create or revoke the grant.</p>
<p dir="auto">For initial setup, run a script to get all the users that have a given role (using a user search query) and then grant them access to all the entities.</p>
<p dir="auto">Think about what happens when a new piece of equipment is added. From what I gather, all users with the "viewer" role will need to be granted access to that equipment. You can take care that of within the 'new equipment added' script: provision the equipment, then add the grant to all users with the "viewer" role.</p>
<p dir="auto">Depending on when you are going to check the grant and the number of users and pieces of equipment, this may be a good thing to use a queue like SQS for, to add/revoke/update grants asynchronously.</p>
]]></description><link>https://fusionauth.io/community/forum/post/4147</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/4147</guid><dc:creator><![CDATA[dan]]></dc:creator><pubDate>Tue, 04 Jan 2022 16:32:30 GMT</pubDate></item></channel></rss>