Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Kontr 2.0
Portal API Backend
Commits
63291a78
Verified
Commit
63291a78
authored
Oct 14, 2018
by
Peter Stanko
Browse files
Removed unnecessary permissions
parent
69554be8
Changes
8
Hide whitespace changes
Inline
Side-by-side
docs/prirucka.adoc
View file @
63291a78
...
...
@@ -369,10 +369,6 @@ sú maximálnou hodnotou povolení jeho rolí.
** typicky vhodná pre vlastníka kurzu
** zatiaľ nevyužitá hodnota (archivácia projektov nie je implementovaná)
* assign_roles:
** povoľuje manipuláciu so zoznamami používateľov v rolách kurzu
** nepovoľuje iné zmeny rolí
* create_submissions:
** povoľuje vytváranie odovzdaní pod vlastnou identitou s ohľadom na časové obmedzenia projektov (submissions allowed from-to)
** typické povolenie pre študenta
...
...
management/data/__init__.py
View file @
63291a78
...
...
@@ -186,6 +186,7 @@ class DataManagement(object):
def
import_users
(
self
,
file
,
course
=
None
,
role
=
None
,
group
=
None
):
with
self
.
app
.
app_context
():
course
=
self
.
rest
.
find
.
course
(
course
)
if
role
:
role
=
self
.
rest
.
find
.
role
(
course
,
role
)
if
group
:
...
...
management/data/shared.py
View file @
63291a78
...
...
@@ -34,7 +34,6 @@ PERM_TEACHER = dict(
view_course_full
=
True
,
update_course
=
True
,
handle_notes_access_token
=
False
,
assign_roles
=
True
,
write_roles
=
True
,
write_groups
=
True
,
write_projects
=
True
,
...
...
@@ -57,7 +56,6 @@ PERM_OWNER = dict(
view_course_full
=
True
,
update_course
=
True
,
handle_notes_access_token
=
True
,
assign_roles
=
True
,
write_roles
=
True
,
write_groups
=
True
,
write_projects
=
True
,
...
...
migrations/versions/f8d48cce72cb_.py
0 → 100644
View file @
63291a78
"""empty message
Revision ID: f8d48cce72cb
Revises: cdb5d9fc0f2c
Create Date: 2018-10-14 21:47:33.754224
"""
from
alembic
import
op
import
sqlalchemy
as
sa
# revision identifiers, used by Alembic.
revision
=
'f8d48cce72cb'
down_revision
=
'cdb5d9fc0f2c'
branch_labels
=
None
depends_on
=
None
def
upgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
drop_column
(
'rolePermissions'
,
'read_roles'
)
op
.
drop_column
(
'rolePermissions'
,
'assign_roles'
)
op
.
drop_column
(
'rolePermissions'
,
'read_groups'
)
op
.
drop_column
(
'rolePermissions'
,
'read_projects'
)
# ### end Alembic commands ###
def
downgrade
():
# ### commands auto generated by Alembic - please adjust! ###
op
.
add_column
(
'rolePermissions'
,
sa
.
Column
(
'read_projects'
,
sa
.
BOOLEAN
(),
autoincrement
=
False
,
nullable
=
False
))
op
.
add_column
(
'rolePermissions'
,
sa
.
Column
(
'read_groups'
,
sa
.
BOOLEAN
(),
autoincrement
=
False
,
nullable
=
False
))
op
.
add_column
(
'rolePermissions'
,
sa
.
Column
(
'assign_roles'
,
sa
.
BOOLEAN
(),
autoincrement
=
False
,
nullable
=
False
))
op
.
add_column
(
'rolePermissions'
,
sa
.
Column
(
'read_roles'
,
sa
.
BOOLEAN
(),
autoincrement
=
False
,
nullable
=
False
))
# ### end Alembic commands ###
portal/database/models.py
View file @
63291a78
...
...
@@ -766,15 +766,9 @@ class RolePermissions(db.Model, EntityBase):
handle_notes_access_token
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
assign_roles
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
write_roles
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
read_roles
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
write_groups
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
read_groups
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
write_projects
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
read_projects
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
archive_projects
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
create_submissions
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
...
...
portal/rest/schemas.py
View file @
63291a78
...
...
@@ -220,15 +220,9 @@ class RolePermissionsSchema(BaseSchema, Schema):
update_course
=
fields
.
Bool
()
handle_notes_access_token
=
fields
.
Bool
()
assign_roles
=
fields
.
Bool
()
write_roles
=
fields
.
Bool
()
read_roles
=
fields
.
Bool
()
write_groups
=
fields
.
Bool
()
read_groups
=
fields
.
Bool
()
write_projects
=
fields
.
Bool
()
read_projects
=
fields
.
Bool
()
archive_projects
=
fields
.
Bool
()
create_submissions
=
fields
.
Bool
()
...
...
tests/database/test_db.py
View file @
63291a78
...
...
@@ -810,8 +810,6 @@ def test_role_permissions_create(session):
assert
role
.
permissions
.
view_course_limited
is
True
assert
role
.
permissions
.
view_course_full
is
True
assert
role
.
permissions
.
read_roles
is
True
assert
role
.
permissions
.
read_groups
is
True
assert
role
.
permissions
.
read_submissions_all
is
True
assert
role
.
permissions
.
evaluate_submissions
is
False
...
...
tests/rest/rest_tools.py
View file @
63291a78
...
...
@@ -204,15 +204,9 @@ def assert_role_permissions(expected: Role, actual: dict):
assert
expected
.
update_course
==
actual
[
'update_course'
]
assert
expected
.
handle_notes_access_token
==
actual
[
'handle_notes_access_token'
]
assert
expected
.
assign_roles
==
actual
[
'assign_roles'
]
assert
expected
.
write_roles
==
actual
[
'write_roles'
]
assert
expected
.
read_roles
==
actual
[
'read_roles'
]
assert
expected
.
write_groups
==
actual
[
'write_groups'
]
assert
expected
.
read_groups
==
actual
[
'read_groups'
]
assert
expected
.
write_projects
==
actual
[
'write_projects'
]
assert
expected
.
read_projects
==
actual
[
'read_projects'
]
assert
expected
.
archive_projects
==
actual
[
'archive_projects'
]
assert
expected
.
create_submissions
==
actual
[
'create_submissions'
]
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment