Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Sang D NGO
linagora.esn.most
Commits
553a95ac
Commit
553a95ac
authored
Apr 17, 2018
by
Sang D NGO
Browse files
expert can see only proposal reviewed by them
parent
702bdf6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
backend/lib/proposal/index.js
backend/lib/proposal/index.js
+4
-0
backend/webserver/api/proposals/controller.js
backend/webserver/api/proposals/controller.js
+1
-0
frontend/app/common/most-proposal-api-client.service.js
frontend/app/common/most-proposal-api-client.service.js
+6
-1
No files found.
backend/lib/proposal/index.js
View file @
553a95ac
...
...
@@ -29,6 +29,10 @@ module.exports = function(dependencies) {
query
.
creator
=
options
.
creator
;
}
if
(
options
.
reviewer
)
{
query
.
reviewers
=
options
.
reviewer
;
}
if
(
options
.
status
)
{
query
.
status
=
options
.
status
;
}
...
...
backend/webserver/api/proposals/controller.js
View file @
553a95ac
...
...
@@ -38,6 +38,7 @@ module.exports = function(dependencies, lib) {
function
getProposals
(
req
,
res
)
{
var
listOptions
=
{
creator
:
req
.
query
.
creator
,
reviewer
:
req
.
query
.
reviewer
,
type
:
req
.
query
.
type
,
status
:
req
.
query
.
status
,
limit
:
Number
(
req
.
query
.
limit
),
...
...
frontend/app/common/most-proposal-api-client.service.js
View file @
553a95ac
...
...
@@ -8,6 +8,7 @@
function
mostProposalApiClient
(
session
,
mostRoleService
,
mostRestangular
)
{
return
{
...
...
@@ -22,8 +23,12 @@
}
function
getProposals
(
options
)
{
if
(
!
session
.
userIsDomainAdministrator
())
{
var
userRole
=
mostRoleService
.
getRole
();
if
(
userRole
===
'
user
'
)
{
options
.
creator
=
session
.
user
.
_id
;
}
else
if
(
userRole
===
'
expert
'
)
{
options
.
reviewer
=
session
.
user
.
_id
;
}
return
mostRestangular
.
all
(
API_PATH
).
getList
(
options
).
then
(
_stripAndReturnData
).
then
(
function
(
proposals
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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