Fixed errors in client
This commit is contained in:
parent
0367398cb5
commit
a329031942
2
.gitignore
vendored
2
.gitignore
vendored
@ -19,7 +19,7 @@
|
||||
Thumbs.db
|
||||
# Virtual Environment
|
||||
.virtualenv*/*
|
||||
.venv/*
|
||||
.venv
|
||||
server/.venv
|
||||
|
||||
## Compatibility
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user