Hi all, are there any public website integrated Pe...
# permit-saas
t
Hi all, are there any public website integrated Permit via FE SDK? I saw it too complicated, for example when going into a list screen, there are 10 items, each items need to check with about 5 actions, so the list has to check reach 10 x 5 = 50 items
a
Hi @Tuấn Anh, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
Yes, there are public examples demonstrating Permit.io FE SDK integration. Here are some relevant repositories: • permit-fe-sdk - Official Permit.io FE SDK for integrating advanced permissions into frontend applications (1) • permit-demo-element - A React app demoing Permit Elements functionality • permit-vue-example - Implementation of fine-grained authorization in Vue.js demonstrating RBAC, ABAC, and ReBAC models • fe-demo-angular - Angular demo for frontend permissions ​*Regarding your concern about bulk permission checks (50 checks for a list) :*​ The FE SDK is designed to handle this efficiently. The approach uses a ​*bulk permission check*​ via a backend API endpoint that batches multiple checks into a single request. (2) The backend API receives a list of
resourcesAndActions
and calls
permit.check()
for each, returning a
permittedList
in one response.
Copy code
const checkPermissions = async (resourceAndAction) => {
  const { resource, action, userAttributes, resourceAttributes } = resourceAndAction;
  return permit.check(
    { key: userId, attributes: userAttributes },
    action,
    { type: resource, attributes: resourceAttributes, tenant: 'default' }
  ) ;
};
const permittedList = await Promise.all(
  resourcesAndActions.map(checkPermissions)
) ;
The permissions are then loaded once on login and stored in a ​*Pinia store*​ (Vue) or similar state management, so you don't need to make repeated API calls for each item render. The
setAbility
function fetches allowed actions/resources from the backend and stores them in CASL for quick UI toggling. This means your 50 permission checks happen in one bulk request, not 50 separate calls.
To learn more, see the sources I considered: [[1] Other Code Examples](https://docs.permit.io/modeling/other-code-examples) [[2] Managing Frontend Authorization in Vue with CASL](https://www.permit.io/blog/managing-frontend-authorization-in-vue-with-casl)
d
Hi @Tuấn Anh, I see the bot gave a nice response. We have many examples in our github repo and you can also check out our youtube page 🙂 https://www.youtube.com/@permitio
❤️ 1