Skip to content

Commit

Permalink
added add/remove supervisor member management methods on Scope (#773)
Browse files Browse the repository at this point in the history
* added add/remove supervisor member management methods on `Scope`
* added supervisor in the scope enums
* added version check to see if backend is capable enough to handle the supervisor user member userrole.
* updated changelog
* - added tests for supervisor
- checked if all is working ok
Co-authored-by: Jochem Berends <jochem.berends@ke-works.com>
Co-authored-by: radu.iordache <radu.iordache@ke-works.com>
Co-authored-by: jelle.boersma <jelle.boersma@ke-works.com>
  • Loading branch information
jberends committed Oct 13, 2020
1 parent d45b56a commit 472f48f
Show file tree
Hide file tree
Showing 18 changed files with 240 additions and 97 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
rev: v3.2.0
hooks:
- id: check-ast
- id: check-case-conflict
Expand All @@ -23,25 +23,25 @@ repos:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.5.2
rev: v1.5.4
hooks:
- id: autopep8
files: pykechain/.*
- repo: https://github.com/PyCQA/pydocstyle
rev: 5.0.2
rev: 5.1.1
hooks:
- id: pydocstyle
args:
- --ignore=D100,D105,D203,D212,D213,D416
files: pykechain/.*
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.1
rev: 3.8.4
hooks:
- id: flake8
args:
- --ignore=F821
files: pykechain/.*
- repo: https://github.com/mgedmin/check-manifest
rev: '0.42'
rev: '0.44'
hooks:
- id: check-manifest
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ UNRELEASED (DDMMMYY)
* :bug: Missing upper-case letter in `SideBarManager` caused a loss of the `override_sidebar` property.
* :bug: `SidebarButton` class did not preserve all data from the scope options, losing display names in other languages. Editing of this values is now possible as well.
* :+1: Added `refresh()` method on `SideBarManager` to reload the side-bar from KE-chain.
* :star: Added the option to manage supervisor members on a scope for KE-chain 3 backends that support the supervisor member users. That is possble for releases of KE-chain 3 starting from June 2020. (version 3.7). #772
* :+1: Changed the way edit functions work for `Part`, `Properties`, `Activity`, `Scope`, `Notification`, `Service`, `Team` and `Banner` classes. Passing inputs with value None in those functions will clear those attributes if possible. Not mentioning them will not overwrite their values.

* :bug: Updating or setting of widget associations with only readable and/or writable properties is now supported.
Expand Down
2 changes: 2 additions & 0 deletions pykechain/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
'scope_remove_manager': 'api/v3/scopes/{scope_id}/remove_manager',
'scope_add_leadmember': 'api/v3/scopes/{scope_id}/add_leadmember',
'scope_remove_leadmember': 'api/v3/scopes/{scope_id}/remove_leadmember',
'scope_add_supervisor': 'api/v3/scopes/{scope_id}/add_supervisor',
'scope_remove_supervisor': 'api/v3/scopes/{scope_id}/remove_supervisor',
'scopes': 'api/v3/scopes.json',
'scopes_clone': 'api/v3/scopes/clone',
'parts': 'api/v3/parts.json',
Expand Down
4 changes: 3 additions & 1 deletion pykechain/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,13 @@ class ScopeRoles(Enum):
Roles that exist for a member of a scope.
:cvar MANAGER: owner of the scope, has full rights
:cvar LEADMEMBER: elevated member, has assignment rights
:cvar SUPERVISOR: supervisor member of a scope, has the rights as leadmember and rights to manage catalog tasks.
:cvar LEADMEMBER: elevated member, has assignment rights, no rights on App tasks or Catalog tasks.
:cvar MEMBER: normal member, only has viewing rights
"""

MANAGER = "manager"
SUPERVISOR = "supervisor"
LEADMEMBER = "leadmember"
MEMBER = "member"

Expand Down
Loading

0 comments on commit 472f48f

Please sign in to comment.