Fixed creation of users + better frontend handling of permissions

This commit is contained in:
cdricms
2025-03-06 17:34:52 +01:00
parent 3c6038bce1
commit 7cb633b4c6
46 changed files with 1511 additions and 909 deletions

View File

@@ -13,8 +13,10 @@ const BlogArticle: React.FC<{ blog: Blog; user?: IUser }> = ({
blog,
user,
}) => {
const perms =
user && hasPermissions(user.roles, { blogs: ["update"] } as const);
const UpdateButton = () => {
if (!user || !hasPermissions(user.roles, { blogs: ["update"] })) return;
if (!perms?.blogs.update) return;
return (
<Button variant="secondary">