-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
The Room Member module manages the association between users and rooms, handling permissions and roles within rooms. This module is designed to be injected into the Room module for managing user access and roles within rooms. Added: * RoomMember Module * Room roles and permissions * Rule for Rooms * Group service: new type 'room' * Group service: new service methods * Migration: insert 2 new roles and 2 new permisisons Changed: * Room Module runs authorization in UC * On new Room also a RoomMember and a Group is created with default user
- Loading branch information
1 parent
cd283f4
commit 81d3b30
Showing
47 changed files
with
1,720 additions
and
62 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
apps/server/src/migrations/mikro-orm/Migration202410041210124.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Migration } from '@mikro-orm/migrations-mongodb'; | ||
|
||
export class Migration202410041210124 extends Migration { | ||
async up(): Promise<void> { | ||
// Add ROOM_VIEWER role | ||
await this.getCollection('roles').insertOne({ | ||
name: 'room_viewer', | ||
permissions: ['ROOM_VIEW'], | ||
}); | ||
console.info('Added ROOM_VIEWER role with ROOM_VIEW permission'); | ||
|
||
// Add ROOM_EDITOR role | ||
await this.getCollection('roles').insertOne({ | ||
name: 'room_editor', | ||
permissions: ['ROOM_VIEW', 'ROOM_EDIT'], | ||
}); | ||
console.info('Added ROOM_EDITOR role with ROOM_VIEW and ROOM_EDIT permissions'); | ||
} | ||
|
||
async down(): Promise<void> { | ||
// Remove ROOM_VIEWER role | ||
await this.getCollection('roles').deleteOne({ name: 'ROOM_VIEWER' }); | ||
console.info('Rollback: Removed ROOM_VIEWER role'); | ||
|
||
// Remove ROOM_EDITOR role | ||
await this.getCollection('roles').deleteOne({ name: 'ROOM_EDITOR' }); | ||
console.info('Rollback: Removed ROOM_EDITOR role'); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
apps/server/src/modules/group/controller/dto/response/group-type.response.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export enum GroupTypeResponse { | ||
CLASS = 'class', | ||
COURSE = 'course', | ||
ROOM = 'room', | ||
OTHER = 'other', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export enum GroupTypes { | ||
CLASS = 'class', | ||
COURSE = 'course', | ||
ROOM = 'room', | ||
OTHER = 'other', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.