Merge pull request #5530 from FinnStutzenstein/hotfix

Fixed errors in client
This commit is contained in:
Emanuel Schütze 2020-09-01 10:06:13 +02:00 committed by GitHub
commit 7a1e7c298d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

2
.gitignore vendored
View File

@ -19,7 +19,7 @@
Thumbs.db
# Virtual Environment
.virtualenv*/*
.venv/*
.venv
server/.venv
## Compatibility

View File

@ -500,6 +500,9 @@ export class UserRepositoryService extends BaseRepository<ViewUser, User, UserTi
}
private preventAlterationOnDemoUsers(users: ViewUser | ViewUser[]): void {
if (!this.demoModeUserIds) {
return;
}
if (Array.isArray(users)) {
if (users.map(user => user.id).intersect(this.demoModeUserIds).length > 0) {
this.preventInDemo();

View File

@ -68,6 +68,9 @@ export class LoadFontService {
*/
private setCustomProjectorFont(font: any, weight: number): void {
const path = font.path ? font.path : font.default;
if (!path) {
return;
}
const url = font.path ? `${this.urlPrefix}${path}` : path;
const fontFace = new FontFace('customProjectorFont', `url(${url})`, { weight: weight });
fontFace

View File

@ -43,10 +43,11 @@ export class VotingService {
* @returns null if no errors exist (= user can vote) or else a VotingError
*/
public getVotePermissionError(poll: ViewBasePoll): VotingError | void {
const user = this.operator.viewUser;
if (this.operator.isAnonymous) {
return VotingError.USER_IS_ANONYMOUS;
}
const user = this.operator.user;
if (!poll.groups_id.intersect(user.groups_id).length) {
return VotingError.USER_HAS_NO_PERMISSION;
}