X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=inline;f=skyquake%2Fplugins%2Fuser_management%2Fsrc%2FplatformRoleManagement%2FplatformRoleManagement.jsx;h=4278d74626a921be2ef22be67fccd38675021aa2;hb=d5f18198d2750fb2a4613846a9885f7b74b6ca93;hp=761ce0dbf37f121564eb2d6b736f86df08688de1;hpb=3d39b18290b9cb3e10c1a80d91ac4819e7c58474;p=osm%2FUI.git
diff --git a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagement.jsx b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagement.jsx
index 761ce0dbf..4278d7462 100644
--- a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagement.jsx
+++ b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagement.jsx
@@ -53,58 +53,35 @@ class PlatformRoleManagement extends React.Component {
platformChange = (platformRole, e) => {
this.actions.handlePlatformRoleUpdate(platformRole, e.currentTarget.checked);
}
- addProjectRole = (e) => {
- this.actions.handleAddProjectItem();
- }
- removeProjectRole = (i, e) => {
- this.actions.handleRemoveProjectItem(i);
- }
- updateProjectRole = (i, e) => {
- this.actions.handleUpdateProjectRole(i, e)
- }
- addProject = () => {
- this.actions.handleAddProject();
- }
- viewProject = (un, index) => {
- this.actions.viewProject(un, index);
- }
editProject = () => {
- this.actions.editProject(false);
+ this.actions.editPlatform(false);
}
- cancelEditProject = () => {
- this.actions.editProject(true)
+ cancelEditPlatform = () => {
+ this.actions.editPlatform(true)
}
closePanel = () => {
this.actions.handleCloseProjectPanel();
}
-
- deleteProject = (e) => {
- e.preventDefault();
- e.stopPropagation();
- this.Store.deleteProject({
- 'name': this.state['name']
- });
- }
updatePlatform = (e) => {
let self = this;
e.preventDefault();
e.stopPropagation();
let platformUsers = self.state.platformUsers;
let cleanUsers = this.cleanUsers(platformUsers);
-
-
this.Store.updatePlatform({
- 'user': platformUsers
+ 'user': JSON.stringify(cleanUsers)
}
);
}
- cleanUsers(projectUsers) {
+ cleanUsers(platformUsers) {
+ let self = this;
let cleanUsers = [];
//Remove null values from role
- projectUsers.map((u) => {
+ platformUsers.map((u) => {
let cleanRoles = [];
u.role && u.role.map((r,i) => {
let role = {};
+ //Platform user can not change role of itself.
if(r.role){
//removing key for rbac-platform
delete r.keys;
@@ -112,7 +89,9 @@ class PlatformRoleManagement extends React.Component {
}
});
u.role = cleanRoles;
- cleanUsers.push(u);
+ if (u['user-name'] != self.context.userProfile.userId) {
+ cleanUsers.push(u);
+ }
});
return cleanUsers;
}
@@ -195,8 +174,7 @@ class PlatformRoleManagement extends React.Component {
(