Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Debian New Member Process
nm.debian.org
Commits
a3b48274
Commit
a3b48274
authored
Jun 03, 2016
by
Enrico Zini
Browse files
Implemented fd_comments permission also in process
parent
15778a7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
process/models.py
View file @
a3b48274
...
@@ -37,6 +37,12 @@ class ProcessVisitorPermissions(bmodels.PersonVisitorPermissions):
...
@@ -37,6 +37,12 @@ class ProcessVisitorPermissions(bmodels.PersonVisitorPermissions):
self
.
process_frozen
=
self
.
process
.
frozen_by
is
not
None
self
.
process_frozen
=
self
.
process
.
frozen_by
is
not
None
self
.
process_approved
=
self
.
process
.
approved_by
is
not
None
self
.
process_approved
=
self
.
process
.
approved_by
is
not
None
a
=
self
.
process
.
current_am_assignment
if
a
is
not
None
:
self
.
is_current_am
=
a
.
am
.
person
==
self
.
visitor
else
:
self
.
is_current_am
=
False
if
not
self
.
process
.
closed
and
self
.
visitor
is
not
None
and
not
self
.
visitor
.
pending
:
if
not
self
.
process
.
closed
and
self
.
visitor
is
not
None
and
not
self
.
visitor
.
pending
:
self
.
add
(
"add_log"
)
self
.
add
(
"add_log"
)
...
@@ -59,6 +65,10 @@ class ProcessVisitorPermissions(bmodels.PersonVisitorPermissions):
...
@@ -59,6 +65,10 @@ class ProcessVisitorPermissions(bmodels.PersonVisitorPermissions):
#elif self.process.advocates.filter(pk=self.visitor.pk).exists():
#elif self.process.advocates.filter(pk=self.visitor.pk).exists():
# self.add("view_mbox")
# self.add("view_mbox")
# The current AM can see fd comments in this process
if
self
.
is_current_am
:
self
.
add
(
"fd_comments"
)
class
RequirementVisitorPermissions
(
ProcessVisitorPermissions
):
class
RequirementVisitorPermissions
(
ProcessVisitorPermissions
):
def
__init__
(
self
,
requirement
,
visitor
):
def
__init__
(
self
,
requirement
,
visitor
):
...
@@ -98,11 +108,10 @@ class RequirementVisitorPermissions(ProcessVisitorPermissions):
...
@@ -98,11 +108,10 @@ class RequirementVisitorPermissions(ProcessVisitorPermissions):
if
self
.
visitor
.
is_dd
:
self
.
add
(
"req_unapprove"
if
self
.
requirement
.
approved_by
else
"req_approve"
)
if
self
.
visitor
.
is_dd
:
self
.
add
(
"req_unapprove"
if
self
.
requirement
.
approved_by
else
"req_approve"
)
elif
self
.
requirement
.
type
==
"am_ok"
:
elif
self
.
requirement
.
type
==
"am_ok"
:
a
=
self
.
process
.
current_am_assignment
a
=
self
.
process
.
current_am_assignment
if
a
is
not
None
:
if
self
.
is_current_am
:
if
a
.
am
.
person
==
self
.
visitor
:
self
.
add
(
"edit_statements"
)
self
.
add
(
"edit_statements"
)
elif
self
.
visitor
.
is_active_am
:
elif
self
.
visitor
.
is_active_am
:
self
.
add
(
"req_unapprove"
if
self
.
requirement
.
approved_by
else
"req_approve"
)
self
.
add
(
"req_unapprove"
if
self
.
requirement
.
approved_by
else
"req_approve"
)
class
ProcessManager
(
models
.
Manager
):
class
ProcessManager
(
models
.
Manager
):
...
...
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