Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
cebfa63b
Commit
cebfa63b
authored
4 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Přidána role školního garanta
Zatím má dost velka práva, časem omezíme.
parent
1c64e540
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
db/db.ddl
+1
-0
1 addition, 0 deletions
db/db.ddl
db/upgrade-20210115b.sql
+3
-0
3 additions, 0 deletions
db/upgrade-20210115b.sql
mo/db.py
+2
-0
2 additions, 0 deletions
mo/db.py
mo/rights.py
+15
-0
15 additions, 0 deletions
mo/rights.py
with
21 additions
and
0 deletions
db/db.ddl
+
1
−
0
View file @
cebfa63b
...
...
@@ -197,6 +197,7 @@ CREATE TYPE role_type AS ENUM (
'garant', -- celostátní garant (může být omezený na kategorii)
'garant_kraj', -- krajský garant
'garant_okres', -- okresní garant
'garant_skola', -- školní garant
'dozor', -- dozor na soutěži (může odevzdávat řešení za účastníky)
'opravovatel' -- opravovatel
);
...
...
This diff is collapsed.
Click to expand it.
db/upgrade-20210115b.sql
0 → 100644
+
3
−
0
View file @
cebfa63b
SET
ROLE
'mo_osmo'
;
ALTER
TYPE
role_type
ADD
VALUE
'garant_skola'
AFTER
'garant_okres'
;
This diff is collapsed.
Click to expand it.
mo/db.py
+
2
−
0
View file @
cebfa63b
...
...
@@ -348,6 +348,7 @@ class RoleType(MOEnum):
garant
=
auto
()
garant_kraj
=
auto
()
garant_okres
=
auto
()
garant_skola
=
auto
()
dozor
=
auto
()
opravovatel
=
auto
()
...
...
@@ -359,6 +360,7 @@ role_type_names = {
RoleType
.
garant
:
'
celostátní garant
'
,
RoleType
.
garant_kraj
:
'
krajský garant
'
,
RoleType
.
garant_okres
:
'
okresní garant
'
,
RoleType
.
garant_skola
:
'
školní garant
'
,
RoleType
.
dozor
:
'
dozor
'
,
RoleType
.
opravovatel
:
'
opravovatel
'
,
}
...
...
This diff is collapsed.
Click to expand it.
mo/rights.py
+
15
−
0
View file @
cebfa63b
...
...
@@ -84,6 +84,21 @@ roles: List[Role] = [
Right
.
edit_users
,
},
),
Role
(
role
=
db
.
RoleType
.
garant_skola
,
rights
=
{
# FIXME: Až se pořádně rozjedou školní kola, asi chceme školním správcům omezit
# práva na editaci uživatelů. Viz issue #66.
Right
.
assign_rights
,
Right
.
edit_place
,
Right
.
manage_contest
,
Right
.
view_submits
,
Right
.
upload_submits
,
Right
.
edit_points
,
Right
.
add_users
,
Right
.
edit_users
,
},
),
Role
(
role
=
db
.
RoleType
.
dozor
,
rights
=
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment