* inital pbac setup * fix tests * docs intro * more docs * add comments in docs * revert pr_todo * update to use action + custom as defaults * use enums * move to change user role + multi check * add beforeEach import * docs: add PERMISSIONS.md documenting team/organization role usages Co-Authored-By: [email protected] <[email protected]> * docs: add permission string alternatives for helper functions Co-Authored-By: [email protected] <[email protected]> * feat: enhance permission registry and default role permissions Co-Authored-By: [email protected] <[email protected]> * add routers * add hooks + rsc. Also adjsuted test to use prismock * make hooks type safe + add some tests * add a permission context - trpc router to populate context * update docs * explore global and default roles member,admin,owner * fix tests * use kysley and abstract uril * tidy up * update trpc to use pbac route in endpoint + distinct on teamId * make transform util * remove role service dependancy from permission check class * checkTeamId fall back to orgId if team is parent * todos * remove manual migrations to launch softly * address feedback * move permission checks to a repo * move role service database calls to repo. improve mocks * update tests to have describe import * fix types * remove router that is not used to pass build --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
21 lines
624 B
TypeScript
21 lines
624 B
TypeScript
export function PermissionProvider({ children }: { children: React.ReactNode }) {
|
|
// const { data: permissions, isLoading } = trpc.viewer.pbac.getUserPermissions.useQuery(undefined, {
|
|
// // Since permissions don't change often, we can cache them for a while
|
|
// staleTime: 5 * 60 * 1000, // 5 minutes
|
|
// });
|
|
|
|
// const setTeamPermissions = usePermissionStore((state) => state.setTeamPermissions);
|
|
|
|
// useEffect(() => {
|
|
// if (permissions) {
|
|
// setTeamPermissions(permissions);
|
|
// }
|
|
// }, [permissions, setTeamPermissions]);
|
|
|
|
if (isLoading) {
|
|
return null;
|
|
}
|
|
|
|
return <>{children}</>;
|
|
}
|