X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Fuser_management%2Fsrc%2FplatformRoleManagement%2FplatformRoleManagement.jsx;h=4278d74626a921be2ef22be67fccd38675021aa2;hp=de5064bef408ba104ac24c3168eeb58caede9c45;hb=1cf9754552bff8deccef6710bc2cd60f508939e9;hpb=a0fefa94b21ae1620756cda0d22d5de90b9bcaa9
diff --git a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagement.jsx b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagement.jsx
index de5064bef..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': JSON.stringify(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 {
(