Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
ccaa3905
Commit
ccaa3905
authored
Jan 28, 2019
by
Piotr Gawron
Browse files
do not attempt to update privileges if not authorized
parent
4da44009
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend-js/src/main/js/ServerConnector.js
View file @
ccaa3905
...
...
@@ -36,6 +36,7 @@ var SbmlParameter = require('./map/data/SbmlParameter');
var
SecurityError
=
require
(
'
./SecurityError
'
);
var
SessionData
=
require
(
'
./SessionData
'
);
var
User
=
require
(
'
./map/data/User
'
);
var
PrivilegeType
=
require
(
'
./map/data/PrivilegeType
'
);
var
GuiConnector
=
require
(
'
./GuiConnector
'
);
...
...
@@ -1232,9 +1233,17 @@ ServerConnector.updateUser = function (user) {
connectedToLdap
:
user
.
isConnectedToLdap
()
}
};
return
self
.
sendPatchRequest
(
self
.
getUserUrl
(
queryParams
),
filterParams
).
then
(
function
()
{
var
canModifyPrivileges
=
false
;
return
self
.
sendPatchRequest
(
self
.
getUserUrl
(
queryParams
),
filterParams
).
then
(
function
(
response
)
{
canModifyPrivileges
=
JSON
.
parse
(
response
).
privileges
.
some
(
function
(
privilege
)
{
return
privilege
.
type
===
PrivilegeType
.
USER_MANAGEMENT
||
privilege
.
type
===
PrivilegeType
.
PROJECT_MANAGEMENT
;
});
return
self
.
getConfiguration
();
}).
then
(
function
(
configuration
)
{
if
(
!
canModifyPrivileges
)
{
return
Promise
.
resolve
();
}
return
self
.
updateUserPrivileges
({
user
:
user
,
privileges
:
user
.
privilegesToExport
(
configuration
)});
});
};
...
...
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