Add new "choir" calendar and add cascading functionality for calendars
Jenkins Production Deployment
Jenkins Production Deployment
This commit is contained in:
@@ -24,6 +24,7 @@ export const eventsRouter = express.Router();
|
||||
export const calendarNames = new Map<string, any>([
|
||||
['public', {id: 1, name: 'Nachklang_calendar'}],
|
||||
['members', {id: 2, name: 'Nachklang_internal_calendar'}],
|
||||
['choir', {id: 4, name: 'Nachklang_choir_calendar'}],
|
||||
['management', {id: 3, name: 'Nachklang_management_calendar'}]
|
||||
]);
|
||||
|
||||
@@ -55,6 +56,7 @@ eventsRouter.get('/:calendar/json', async (req: Request, res: Response) => {
|
||||
|
||||
let user = await UserService.checkSession(sessionId, sessionKey, ip);
|
||||
|
||||
// If no user was found, check if the password gives access to the calendar
|
||||
if(user === null || !user.isActive) {
|
||||
if (! await CredentialService.hasAccess(calendarName, sessionId, sessionKey, password, ip)) {
|
||||
res.status(403).send({'message': 'You do not have access to the specified calendar.'});
|
||||
|
||||
Reference in New Issue
Block a user