diff --git a/apps/server/src/modules/authorization/authorization.module.ts b/apps/server/src/modules/authorization/authorization.module.ts index 0ec33f737ac..e56448a9657 100644 --- a/apps/server/src/modules/authorization/authorization.module.ts +++ b/apps/server/src/modules/authorization/authorization.module.ts @@ -15,7 +15,7 @@ import { UserRule, UserLoginMigrationRule, LegacySchoolRule, -} from './domain/service/rules'; +} from './domain/rules'; import { AuthorizationHelper, AuthorizationService, RuleManager } from './domain'; import { FeathersAuthorizationService, FeathersAuthProvider } from './feathers'; diff --git a/apps/server/src/modules/authorization/domain/service/rules/board-do.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/board-do.rule.spec.ts similarity index 98% rename from apps/server/src/modules/authorization/domain/service/rules/board-do.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/board-do.rule.spec.ts index aaf0350fc70..bda3680b460 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/board-do.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/board-do.rule.spec.ts @@ -3,8 +3,8 @@ import { roleFactory, setupEntities, userFactory } from '@shared/testing'; import { ObjectId } from 'bson'; import { BoardDoAuthorizable, BoardRoles, UserRoleEnum } from '@shared/domain/domainobject'; import { Permission } from '@shared/domain/interface'; -import { Action } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { BoardDoRule } from './board-do.rule'; describe(BoardDoRule.name, () => { diff --git a/apps/server/src/modules/authorization/domain/service/rules/board-do.rule.ts b/apps/server/src/modules/authorization/domain/rules/board-do.rule.ts similarity index 91% rename from apps/server/src/modules/authorization/domain/service/rules/board-do.rule.ts rename to apps/server/src/modules/authorization/domain/rules/board-do.rule.ts index 9458f1b9526..2042365e071 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/board-do.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/board-do.rule.ts @@ -1,8 +1,8 @@ import { Injectable } from '@nestjs/common'; import { BoardDoAuthorizable, BoardRoles } from '@shared/domain/domainobject'; import { User } from '@shared/domain/entity'; -import { Action, AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action, AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; @Injectable() export class BoardDoRule implements Rule { diff --git a/apps/server/src/modules/authorization/domain/service/rules/context-external-tool.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.spec.ts similarity index 96% rename from apps/server/src/modules/authorization/domain/service/rules/context-external-tool.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.spec.ts index 4151aa0b24b..ddd458959ed 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/context-external-tool.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.spec.ts @@ -14,8 +14,8 @@ import { SchoolExternalToolEntity } from '@src/modules/tool/school-external-tool import { Role, User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; import { ContextExternalToolRule } from './context-external-tool.rule'; -import { Action } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; describe('ContextExternalToolRule', () => { let service: ContextExternalToolRule; diff --git a/apps/server/src/modules/authorization/domain/service/rules/context-external-tool.rule.ts b/apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.ts similarity index 90% rename from apps/server/src/modules/authorization/domain/service/rules/context-external-tool.rule.ts rename to apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.ts index 072a8a2356a..5d57c95a160 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/context-external-tool.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/context-external-tool.rule.ts @@ -2,8 +2,8 @@ import { Injectable } from '@nestjs/common'; import { ContextExternalTool } from '@src/modules/tool/context-external-tool/domain'; import { ContextExternalToolEntity } from '@src/modules/tool/context-external-tool/entity'; import { User } from '@shared/domain/entity'; -import { AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; @Injectable() export class ContextExternalToolRule implements Rule { diff --git a/apps/server/src/modules/authorization/domain/service/rules/course-group.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/course-group.rule.spec.ts similarity index 98% rename from apps/server/src/modules/authorization/domain/service/rules/course-group.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/course-group.rule.spec.ts index 64bc6a1523b..62c14baa138 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/course-group.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/course-group.rule.spec.ts @@ -4,8 +4,8 @@ import { Permission } from '@shared/domain/interface'; import { courseFactory, courseGroupFactory, roleFactory, setupEntities, userFactory } from '@shared/testing'; import { CourseGroupRule } from './course-group.rule'; import { CourseRule } from './course.rule'; -import { Action } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; describe('CourseGroupRule', () => { let service: CourseGroupRule; diff --git a/apps/server/src/modules/authorization/domain/service/rules/course-group.rule.ts b/apps/server/src/modules/authorization/domain/rules/course-group.rule.ts similarity index 87% rename from apps/server/src/modules/authorization/domain/service/rules/course-group.rule.ts rename to apps/server/src/modules/authorization/domain/rules/course-group.rule.ts index 395651dbda7..863d7072ec8 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/course-group.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/course-group.rule.ts @@ -1,8 +1,8 @@ import { Injectable } from '@nestjs/common'; import { CourseGroup, User } from '@shared/domain/entity'; import { CourseRule } from './course.rule'; -import { Action, AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action, AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; @Injectable() export class CourseGroupRule implements Rule { diff --git a/apps/server/src/modules/authorization/domain/service/rules/course.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/course.rule.spec.ts similarity index 96% rename from apps/server/src/modules/authorization/domain/service/rules/course.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/course.rule.spec.ts index 84b67cfc5d1..1c4dcc7d670 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/course.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/course.rule.spec.ts @@ -3,8 +3,8 @@ import { Course, User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; import { courseFactory, roleFactory, setupEntities, userFactory } from '@shared/testing'; import { CourseRule } from './course.rule'; -import { Action } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; describe('CourseRule', () => { let service: CourseRule; diff --git a/apps/server/src/modules/authorization/domain/service/rules/course.rule.ts b/apps/server/src/modules/authorization/domain/rules/course.rule.ts similarity index 86% rename from apps/server/src/modules/authorization/domain/service/rules/course.rule.ts rename to apps/server/src/modules/authorization/domain/rules/course.rule.ts index bb7eed5f4a6..e923e1ab967 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/course.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/course.rule.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { Course, User } from '@shared/domain/entity'; -import { Action, AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action, AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; @Injectable() export class CourseRule implements Rule { diff --git a/apps/server/src/modules/authorization/domain/service/rules/index.ts b/apps/server/src/modules/authorization/domain/rules/index.ts similarity index 100% rename from apps/server/src/modules/authorization/domain/service/rules/index.ts rename to apps/server/src/modules/authorization/domain/rules/index.ts diff --git a/apps/server/src/modules/authorization/domain/service/rules/legacy-school.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/legacy-school.rule.spec.ts similarity index 95% rename from apps/server/src/modules/authorization/domain/service/rules/legacy-school.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/legacy-school.rule.spec.ts index 7acced2b7d8..489def39318 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/legacy-school.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/legacy-school.rule.spec.ts @@ -2,8 +2,8 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; import { roleFactory, legacySchoolDoFactory, setupEntities, userFactory } from '@shared/testing'; import { ObjectID } from 'bson'; -import { Action } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { LegacySchoolRule } from './legacy-school.rule'; describe('LegacySchoolRule', () => { diff --git a/apps/server/src/modules/authorization/domain/service/rules/legacy-school.rule.ts b/apps/server/src/modules/authorization/domain/rules/legacy-school.rule.ts similarity index 87% rename from apps/server/src/modules/authorization/domain/service/rules/legacy-school.rule.ts rename to apps/server/src/modules/authorization/domain/rules/legacy-school.rule.ts index 65ac6daa5ed..e115727091a 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/legacy-school.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/legacy-school.rule.ts @@ -2,8 +2,8 @@ import { Injectable } from '@nestjs/common'; import { BaseDO, LegacySchoolDo } from '@shared/domain'; import { User } from '@shared/domain/entity'; import { AuthorizableObject } from '@shared/domain/domain-object'; -import { AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; /** * @deprecated because it uses the deprecated LegacySchoolDo. diff --git a/apps/server/src/modules/authorization/domain/service/rules/lesson.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/lesson.rule.spec.ts similarity index 97% rename from apps/server/src/modules/authorization/domain/service/rules/lesson.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/lesson.rule.spec.ts index 9e839714811..a409ab50efb 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/lesson.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/lesson.rule.spec.ts @@ -10,8 +10,8 @@ import { setupEntities, userFactory, } from '@shared/testing'; -import { Action } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { CourseGroupRule } from './course-group.rule'; import { CourseRule } from './course.rule'; import { LessonRule } from './lesson.rule'; diff --git a/apps/server/src/modules/authorization/domain/service/rules/lesson.rule.ts b/apps/server/src/modules/authorization/domain/rules/lesson.rule.ts similarity index 95% rename from apps/server/src/modules/authorization/domain/service/rules/lesson.rule.ts rename to apps/server/src/modules/authorization/domain/rules/lesson.rule.ts index c011f128c76..3ea79b82091 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/lesson.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/lesson.rule.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { Course, CourseGroup, LessonEntity, User } from '@shared/domain/entity'; -import { Action, AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action, AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { CourseGroupRule } from './course-group.rule'; import { CourseRule } from './course.rule'; diff --git a/apps/server/src/modules/authorization/domain/service/rules/school-external-tool.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/school-external-tool.rule.spec.ts similarity index 96% rename from apps/server/src/modules/authorization/domain/service/rules/school-external-tool.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/school-external-tool.rule.spec.ts index 18b050dfd43..d1781bb8576 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/school-external-tool.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/school-external-tool.rule.spec.ts @@ -10,8 +10,8 @@ import { import { SchoolExternalTool } from '@src/modules/tool/school-external-tool/domain'; import { SchoolExternalToolEntity } from '@src/modules/tool/school-external-tool/entity'; import { Role, User, Permission } from '@shared/domain'; -import { Action } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { SchoolExternalToolRule } from './school-external-tool.rule'; describe('SchoolExternalToolRule', () => { diff --git a/apps/server/src/modules/authorization/domain/service/rules/school-external-tool.rule.ts b/apps/server/src/modules/authorization/domain/rules/school-external-tool.rule.ts similarity index 90% rename from apps/server/src/modules/authorization/domain/service/rules/school-external-tool.rule.ts rename to apps/server/src/modules/authorization/domain/rules/school-external-tool.rule.ts index 6d607d63229..041c8b523e2 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/school-external-tool.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/school-external-tool.rule.ts @@ -2,8 +2,8 @@ import { Injectable } from '@nestjs/common'; import { SchoolExternalTool } from '@src/modules/tool/school-external-tool/domain'; import { SchoolExternalToolEntity } from '@src/modules/tool/school-external-tool/entity'; import { User } from '@shared/domain/entity'; -import { AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; @Injectable() export class SchoolExternalToolRule implements Rule { diff --git a/apps/server/src/modules/authorization/domain/service/rules/submission.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/submission.rule.spec.ts similarity index 99% rename from apps/server/src/modules/authorization/domain/service/rules/submission.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/submission.rule.spec.ts index 7c56346c370..7d20d53bf21 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/submission.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/submission.rule.spec.ts @@ -9,8 +9,8 @@ import { taskFactory, userFactory, } from '@shared/testing'; -import { Action } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { SubmissionRule } from './submission.rule'; import { TaskRule } from './task.rule'; import { CourseRule } from './course.rule'; diff --git a/apps/server/src/modules/authorization/domain/service/rules/submission.rule.ts b/apps/server/src/modules/authorization/domain/rules/submission.rule.ts similarity index 94% rename from apps/server/src/modules/authorization/domain/service/rules/submission.rule.ts rename to apps/server/src/modules/authorization/domain/rules/submission.rule.ts index 2a2e653d481..a6c26178e7a 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/submission.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/submission.rule.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { Submission, User } from '@shared/domain/entity'; -import { Action, AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action, AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { TaskRule } from './task.rule'; @Injectable() diff --git a/apps/server/src/modules/authorization/domain/service/rules/task.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/task.rule.spec.ts similarity index 98% rename from apps/server/src/modules/authorization/domain/service/rules/task.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/task.rule.spec.ts index 38568289f60..31d68661ff0 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/task.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/task.rule.spec.ts @@ -2,8 +2,8 @@ import { DeepPartial } from '@mikro-orm/core'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission, RoleName } from '@shared/domain/interface'; import { courseFactory, lessonFactory, roleFactory, setupEntities, taskFactory, userFactory } from '@shared/testing'; -import { Action } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { CourseGroupRule } from './course-group.rule'; import { TaskRule } from './task.rule'; import { CourseRule } from './course.rule'; diff --git a/apps/server/src/modules/authorization/domain/service/rules/task.rule.ts b/apps/server/src/modules/authorization/domain/rules/task.rule.ts similarity index 92% rename from apps/server/src/modules/authorization/domain/service/rules/task.rule.ts rename to apps/server/src/modules/authorization/domain/rules/task.rule.ts index 38e85698df6..3ebc04d9f71 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/task.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/task.rule.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { Task, User } from '@shared/domain/entity'; -import { Action, AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action, AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { CourseRule } from './course.rule'; import { LessonRule } from './lesson.rule'; diff --git a/apps/server/src/modules/authorization/domain/service/rules/team.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/team.rule.spec.ts similarity index 97% rename from apps/server/src/modules/authorization/domain/service/rules/team.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/team.rule.spec.ts index 4d688e23279..da99354a49b 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/team.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/team.rule.spec.ts @@ -1,9 +1,9 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; import { roleFactory, setupEntities, userFactory, teamFactory } from '@shared/testing'; -import { AuthorizationHelper } from '../authorization.helper'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { TeamRule } from './team.rule'; -import { AuthorizationContextBuilder } from '../../mapper'; +import { AuthorizationContextBuilder } from '../mapper'; describe('TeamRule', () => { let rule: TeamRule; diff --git a/apps/server/src/modules/authorization/domain/service/rules/team.rule.ts b/apps/server/src/modules/authorization/domain/rules/team.rule.ts similarity index 85% rename from apps/server/src/modules/authorization/domain/service/rules/team.rule.ts rename to apps/server/src/modules/authorization/domain/rules/team.rule.ts index a8850b481a1..2d8f5e90edf 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/team.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/team.rule.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { TeamEntity, TeamUserEntity, User } from '@shared/domain/entity'; -import { AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; @Injectable() export class TeamRule implements Rule { diff --git a/apps/server/src/modules/authorization/domain/service/rules/user-login-migration.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/user-login-migration.rule.spec.ts similarity index 97% rename from apps/server/src/modules/authorization/domain/service/rules/user-login-migration.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/user-login-migration.rule.spec.ts index 7464936eff9..f7fe9d3c53f 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/user-login-migration.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/user-login-migration.rule.spec.ts @@ -4,8 +4,8 @@ import { Test, TestingModule } from '@nestjs/testing'; import { schoolFactory, setupEntities, userFactory, userLoginMigrationDOFactory } from '@shared/testing'; import { UserLoginMigrationDO } from '@shared/domain/domainobject'; import { Permission } from '@shared/domain/interface'; -import { Action, AuthorizationContext } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action, AuthorizationContext } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { UserLoginMigrationRule } from './user-login-migration.rule'; describe('UserLoginMigrationRule', () => { diff --git a/apps/server/src/modules/authorization/domain/service/rules/user-login-migration.rule.ts b/apps/server/src/modules/authorization/domain/rules/user-login-migration.rule.ts similarity index 86% rename from apps/server/src/modules/authorization/domain/service/rules/user-login-migration.rule.ts rename to apps/server/src/modules/authorization/domain/rules/user-login-migration.rule.ts index 485802c04a1..3ae82d02505 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/user-login-migration.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/user-login-migration.rule.ts @@ -1,8 +1,8 @@ import { Injectable } from '@nestjs/common'; import { UserLoginMigrationDO } from '@shared/domain/domainobject'; import { User } from '@shared/domain/entity'; -import { AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; @Injectable() export class UserLoginMigrationRule implements Rule { diff --git a/apps/server/src/modules/authorization/domain/service/rules/user.rule.spec.ts b/apps/server/src/modules/authorization/domain/rules/user.rule.spec.ts similarity index 96% rename from apps/server/src/modules/authorization/domain/service/rules/user.rule.spec.ts rename to apps/server/src/modules/authorization/domain/rules/user.rule.spec.ts index a318e676f9a..85492348f75 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/user.rule.spec.ts +++ b/apps/server/src/modules/authorization/domain/rules/user.rule.spec.ts @@ -2,8 +2,8 @@ import { Test, TestingModule } from '@nestjs/testing'; import { Role, User } from '@shared/domain/entity'; import { Permission } from '@shared/domain/interface'; import { roleFactory, setupEntities, userFactory } from '@shared/testing'; -import { Action } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { Action } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; import { UserRule } from './user.rule'; describe('UserRule', () => { diff --git a/apps/server/src/modules/authorization/domain/service/rules/user.rule.ts b/apps/server/src/modules/authorization/domain/rules/user.rule.ts similarity index 83% rename from apps/server/src/modules/authorization/domain/service/rules/user.rule.ts rename to apps/server/src/modules/authorization/domain/rules/user.rule.ts index 8576659f458..2a1365881e1 100644 --- a/apps/server/src/modules/authorization/domain/service/rules/user.rule.ts +++ b/apps/server/src/modules/authorization/domain/rules/user.rule.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { User } from '@shared/domain/entity'; -import { AuthorizationContext, Rule } from '../../type'; -import { AuthorizationHelper } from '../authorization.helper'; +import { AuthorizationContext, Rule } from '../type'; +import { AuthorizationHelper } from '../service/authorization.helper'; @Injectable() export class UserRule implements Rule { diff --git a/apps/server/src/modules/authorization/domain/service/rule-manager.spec.ts b/apps/server/src/modules/authorization/domain/service/rule-manager.spec.ts index 6c268db1d18..78ef313ade1 100644 --- a/apps/server/src/modules/authorization/domain/service/rule-manager.spec.ts +++ b/apps/server/src/modules/authorization/domain/service/rule-manager.spec.ts @@ -16,7 +16,7 @@ import { TeamRule, UserRule, UserLoginMigrationRule, -} from './rules'; +} from '../rules'; import { RuleManager } from './rule-manager'; describe('RuleManager', () => { diff --git a/apps/server/src/modules/authorization/domain/service/rule-manager.ts b/apps/server/src/modules/authorization/domain/service/rule-manager.ts index 6c5992acf55..77d09f284c2 100644 --- a/apps/server/src/modules/authorization/domain/service/rule-manager.ts +++ b/apps/server/src/modules/authorization/domain/service/rule-manager.ts @@ -15,7 +15,7 @@ import { TeamRule, UserLoginMigrationRule, UserRule, -} from './rules'; +} from '../rules'; @Injectable() export class RuleManager { diff --git a/apps/server/src/modules/sharing/controller/api-test/sharing-create-token.api.spec.ts b/apps/server/src/modules/sharing/controller/api-test/sharing-create-token.api.spec.ts index 769364ca29b..2abd2019fbf 100644 --- a/apps/server/src/modules/sharing/controller/api-test/sharing-create-token.api.spec.ts +++ b/apps/server/src/modules/sharing/controller/api-test/sharing-create-token.api.spec.ts @@ -1,7 +1,7 @@ import { Request } from 'express'; import request from 'supertest'; import { Configuration } from '@hpi-schul-cloud/commons/lib'; -import { EntityManager } from '@mikro-orm/mongodb'; +import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { ExecutionContext, HttpStatus, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { ApiValidationError } from '@shared/common'; @@ -116,9 +116,8 @@ describe(`share token creation (api)`, () => { }); it('should return status 404 when parent id is not found', async () => { - // validation of parentId should be failed on mongoId const response = await api.post({ - parentId: '000011112222333344445555', + parentId: new ObjectId().toHexString(), parentType: ShareTokenParentType.Course, });