fix: allow AWARD_MASTER role to access project files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,7 @@ export const fileRouter = router({
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
.query(async ({ ctx, input }) => {
|
.query(async ({ ctx, input }) => {
|
||||||
const isAdminOrObserver = ['SUPER_ADMIN', 'PROGRAM_ADMIN', 'OBSERVER'].includes(ctx.user.role)
|
const isAdminOrObserver = ['SUPER_ADMIN', 'PROGRAM_ADMIN', 'OBSERVER', 'AWARD_MASTER'].includes(ctx.user.role)
|
||||||
|
|
||||||
if (!isAdminOrObserver) {
|
if (!isAdminOrObserver) {
|
||||||
const file = await ctx.prisma.projectFile.findFirst({
|
const file = await ctx.prisma.projectFile.findFirst({
|
||||||
@@ -307,7 +307,7 @@ export const fileRouter = router({
|
|||||||
roundId: z.string().optional(),
|
roundId: z.string().optional(),
|
||||||
}))
|
}))
|
||||||
.query(async ({ ctx, input }) => {
|
.query(async ({ ctx, input }) => {
|
||||||
const isAdminOrObserver = ['SUPER_ADMIN', 'PROGRAM_ADMIN', 'OBSERVER'].includes(ctx.user.role)
|
const isAdminOrObserver = ['SUPER_ADMIN', 'PROGRAM_ADMIN', 'OBSERVER', 'AWARD_MASTER'].includes(ctx.user.role)
|
||||||
|
|
||||||
if (!isAdminOrObserver) {
|
if (!isAdminOrObserver) {
|
||||||
const [juryAssignment, mentorAssignment, teamMembership] = await Promise.all([
|
const [juryAssignment, mentorAssignment, teamMembership] = await Promise.all([
|
||||||
@@ -376,7 +376,7 @@ export const fileRouter = router({
|
|||||||
roundId: z.string(),
|
roundId: z.string(),
|
||||||
}))
|
}))
|
||||||
.query(async ({ ctx, input }) => {
|
.query(async ({ ctx, input }) => {
|
||||||
const isAdminOrObserver = ['SUPER_ADMIN', 'PROGRAM_ADMIN', 'OBSERVER'].includes(ctx.user.role)
|
const isAdminOrObserver = ['SUPER_ADMIN', 'PROGRAM_ADMIN', 'OBSERVER', 'AWARD_MASTER'].includes(ctx.user.role)
|
||||||
|
|
||||||
if (!isAdminOrObserver) {
|
if (!isAdminOrObserver) {
|
||||||
const [juryAssignment, mentorAssignment, teamMembership] = await Promise.all([
|
const [juryAssignment, mentorAssignment, teamMembership] = await Promise.all([
|
||||||
@@ -496,7 +496,7 @@ export const fileRouter = router({
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
.mutation(async ({ ctx, input }) => {
|
.mutation(async ({ ctx, input }) => {
|
||||||
const isAdminOrObserver = ['SUPER_ADMIN', 'PROGRAM_ADMIN', 'OBSERVER'].includes(ctx.user.role)
|
const isAdminOrObserver = ['SUPER_ADMIN', 'PROGRAM_ADMIN', 'OBSERVER', 'AWARD_MASTER'].includes(ctx.user.role)
|
||||||
|
|
||||||
if (!isAdminOrObserver) {
|
if (!isAdminOrObserver) {
|
||||||
// Check user has access to the project (assigned or team member)
|
// Check user has access to the project (assigned or team member)
|
||||||
@@ -680,7 +680,7 @@ export const fileRouter = router({
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
.query(async ({ ctx, input }) => {
|
.query(async ({ ctx, input }) => {
|
||||||
const isAdminOrObserver = ['SUPER_ADMIN', 'PROGRAM_ADMIN', 'OBSERVER'].includes(ctx.user.role)
|
const isAdminOrObserver = ['SUPER_ADMIN', 'PROGRAM_ADMIN', 'OBSERVER', 'AWARD_MASTER'].includes(ctx.user.role)
|
||||||
|
|
||||||
if (!isAdminOrObserver) {
|
if (!isAdminOrObserver) {
|
||||||
const [assignment, mentorAssignment, teamMembership] = await Promise.all([
|
const [assignment, mentorAssignment, teamMembership] = await Promise.all([
|
||||||
|
|||||||
Reference in New Issue
Block a user