Closed gregleeper closed 10 months ago
Ah yeah, that'll need to be refactored a bit to separate the server-only utils from the UI utils.
Kent i looked through and found that permission.ts is only called a single place in the client https://github.com/epicweb-dev/epic-stack/blob/main/app/routes/users%2B/%24username_%2B/notes.%24noteId.tsx#L112
If you like we can remove either that and pass something is isOwner (boolean) down from loader and remove the code entirely and then convert permission.ts to fully server side.
The utility is useful for people to use as they build out their site, so we should split them up into a .server file for the server stuff and a regular file for the UI stuff
For me, I moved userHasPermission
and userHasRole
to the user.ts
utility as it made just as much sense there. I moved the rest of the permissions.ts
file to the permissions.server.ts
file.
This has been resolved. Thanks everyone!
I have borrowed the role based permissions model from the epic-stack. I am using it with the Vite Remix plugin. It notified me that the
#/utils/permissions.ts
file, which is client side, is referencing the#/utils/auth.server.ts
file, which is server only code.