-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init rbac db schema #19
Conversation
packages/auth/src/rbac/index.ts
Outdated
workspace, | ||
} from "@ctrlplane/db/schema"; | ||
|
||
const scopeHierarchy: Array<ScopeType> = ["deployment", "system", "workspace"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How exactly is the Hierarchy defined?
is it left to right?
.orderBy(sql`ARRAY_POSITION(${scopeHierarchy}, ${entityRole.scopeType})`)
try { | ||
const system = await create.mutateAsync({ workspaceId, ...values }); | ||
await utils.system.list.invalidate(); | ||
router.push(`/${workspaceSlug}/systems/${system.slug}`); | ||
} catch (e) { | ||
console.error(e); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will handle this with the slug validation once my other PR looks good.
<SelectTrigger className="w-[200px]"> | ||
<SelectValue placeholder="Select a role" /> | ||
</SelectTrigger> | ||
<SelectContent className="w-[200px]"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
w-48 | width: 12rem; /* 192px */
w-52 | width: 13rem; /* 208px */
|
||
return ( | ||
<Select defaultValue={currentRoleId}> | ||
<SelectTrigger className="w-[230px]"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
w-56 | width: 14rem; /* 224px */
w-60 | width: 15rem; /* 240px */
packages/api/src/router/user.ts
Outdated
// viewerAllPermissions: protectedProcedure.query(({ ctx }) => | ||
// ctx.db | ||
// .selectDistinct({ permission: rolePermission.permission }) | ||
// .from(rolePermission) | ||
// .innerJoin(role, eq(role.id, rolePermission.roleId)) | ||
// .innerJoin(entityRole, eq(entityRole.roleId, role.id)) | ||
// .innerJoin( | ||
// user, | ||
// and(eq(user.id, entityRole.id), eq(entityRole.entityType, "user")), | ||
// ) | ||
// .where(eq(user.id, ctx.session.user.id)), | ||
// ), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete?
Just fix the build and lint. |
No description provided.