Skip to content
Snippets Groups Projects
Commit 727ae889 authored by Martin Mareš's avatar Martin Mareš
Browse files

Práva: Každý job má dveřníka

parent d8feab2d
Branches
No related tags found
1 merge request!19Reforma vyhodnocování práv
This commit is part of merge request !19. Comments created here will be created in the context of that merge request.
...@@ -4,12 +4,12 @@ from datetime import timedelta ...@@ -4,12 +4,12 @@ from datetime import timedelta
import os import os
import secrets import secrets
from sqlalchemy import or_ from sqlalchemy import or_
from sqlalchemy.orm import joinedload
from typing import Optional, Dict, Callable, List from typing import Optional, Dict, Callable, List
import mo import mo
import mo.config as config import mo.config as config
import mo.db as db import mo.db as db
import mo.rights
import mo.util import mo.util
from mo.util import logger from mo.util import logger
...@@ -29,6 +29,7 @@ class TheJob: ...@@ -29,6 +29,7 @@ class TheJob:
job: db.Job job: db.Job
job_id: Optional[int] job_id: Optional[int]
gatekeeper: Optional[mo.rights.Gatekeeper]
errors: List[str] errors: List[str]
def __init__(self, job_id: Optional[int] = None): def __init__(self, job_id: Optional[int] = None):
...@@ -115,6 +116,7 @@ class TheJob: ...@@ -115,6 +116,7 @@ class TheJob:
sess.commit() sess.commit()
try: try:
self.gatekeeper = mo.rights.Gatekeeper(job.user)
_handler_table[job.type](self) _handler_table[job.type](self)
if self.errors: if self.errors:
logger.info(f'Job: Neúspěšně dokončen job #{job.job_id} ({job.result})') logger.info(f'Job: Neúspěšně dokončen job #{job.job_id} ({job.result})')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment