Fixed creation of users + better frontend handling of permissions
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user