Fixed errors in client

This commit is contained in:
Finn Stutzenstein 2020-08-27 10:14:59 +02:00
parent 0367398cb5
commit a329031942
No known key found for this signature in database
GPG Key ID: 9042F605C6324654
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;
}