From dd9191fcec6b5464c72b059a24a638af231bcd6f Mon Sep 17 00:00:00 2001 From: Mark Peace Date: Wed, 31 Aug 2016 16:00:03 +0100 Subject: [PATCH] Update security procedure names --- app/scripts/controllers/Main.coffee | 2 +- app/scripts/services/UtilityBolt.coffee | 20 ++++++++++---------- app/scripts/services/UtilityREST.coffee | 20 ++++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/scripts/controllers/Main.coffee b/app/scripts/controllers/Main.coffee index de83417c6c1..4935edd53cc 100644 --- a/app/scripts/controllers/Main.coffee +++ b/app/scripts/controllers/Main.coffee @@ -69,7 +69,7 @@ angular.module('neo4jApp.controllers') ).then( -> fetchJMX() ).then( -> - if 'dbms.listUsers' in $scope.procedures + if 'dbms.security.listUsers' in $scope.procedures ProtocolFactory.getStoredProcedureService().getUser().then((res) -> $scope.user = res Features.showAdmin = 'admin' in res.roles diff --git a/app/scripts/services/UtilityBolt.coffee b/app/scripts/services/UtilityBolt.coffee index ff6f0ea6402..c763c64ae1a 100644 --- a/app/scripts/services/UtilityBolt.coffee +++ b/app/scripts/services/UtilityBolt.coffee @@ -70,7 +70,7 @@ angular.module('neo4jApp.services') getUser: -> q = $q.defer() - Bolt.boltTransaction('CALL dbms.showCurrentUser()').promise + Bolt.boltTransaction('CALL dbms.security.showCurrentUser()').promise .then((r) -> q.resolve Bolt.constructUserResult r) .catch((e) -> q.reject Bolt.constructResult e) q.promise @@ -78,63 +78,63 @@ angular.module('neo4jApp.services') getUserList: -> q = $q.defer() - Bolt.boltTransaction('CALL dbms.listUsers()').promise + Bolt.boltTransaction('CALL dbms.security.listUsers()').promise .then((r) -> q.resolve Bolt.constructUserListResult r) .catch((e) -> q.reject Bolt.constructResult e) q.promise getRolesList: -> q = $q.defer() - Bolt.boltTransaction('CALL dbms.listRoles() YIELD role').promise + Bolt.boltTransaction('CALL dbms.security.listRoles() YIELD role').promise .then((r) -> q.resolve Bolt.constructRolesListResult r) .catch((e) -> q.reject Bolt.constructResult e) q.promise addNewUser: (username, password, requirePasswordChange) -> q = $q.defer() - Bolt.boltTransaction("CALL dbms.createUser({username}, {password}, {requirePasswordChange})", {username: username, password: password, requirePasswordChange: requirePasswordChange}).promise + Bolt.boltTransaction("CALL dbms.security.createUser({username}, {password}, {requirePasswordChange})", {username: username, password: password, requirePasswordChange: requirePasswordChange}).promise .then((r) -> q.resolve r) .catch((e) -> q.reject Bolt.constructResult e) q.promise changeUserPassword: (username, password) -> q = $q.defer() - Bolt.boltTransaction("CALL dbms.changeUserPassword({username}, {password})", {username: username, password: password}).promise + Bolt.boltTransaction("CALL dbms.security.changeUserPassword({username}, {password})", {username: username, password: password}).promise .then((r) -> q.resolve r) .catch((e) -> q.reject Bolt.constructResult e) q.promise activateUser: (username) -> q = $q.defer() - Bolt.boltTransaction("CALL dbms.activateUser({username})", {username: username}).promise + Bolt.boltTransaction("CALL dbms.security.activateUser({username})", {username: username}).promise .then((r) -> q.resolve r) .catch((e) -> q.reject (Bolt.constructResult e).data) q.promise suspendUser: (username) -> q = $q.defer() - Bolt.boltTransaction("CALL dbms.suspendUser({username})", {username: username}).promise + Bolt.boltTransaction("CALL dbms.security.suspendUser({username})", {username: username}).promise .then((r) -> q.resolve r) .catch((e) -> q.reject (Bolt.constructResult e).data) q.promise deleteUser: (username) -> q = $q.defer() - Bolt.boltTransaction("CALL dbms.deleteUser({username})", {username: username}).promise + Bolt.boltTransaction("CALL dbms.security.deleteUser({username})", {username: username}).promise .then((r) -> q.resolve r) .catch((e) -> q.reject (Bolt.constructResult e).data) q.promise addUserToRole: (username, role) -> q = $q.defer() - Bolt.boltTransaction("CALL dbms.addUserToRole({username}, {role})", {username: username, role: role}).promise + Bolt.boltTransaction("CALL dbms.security.addRoleToUser({role}, {username})", {username: username, role: role}).promise .then((r) -> q.resolve r) .catch((e) -> q.reject (Bolt.constructResult e).data) q.promise removeRoleFromUser: (username, role) -> q = $q.defer() - Bolt.boltTransaction("CALL dbms.removeUserFromRole({username}, {role})", {username: username, role: role}).promise + Bolt.boltTransaction("CALL dbms.security.removeRoleFromUser({role}, {username})", {username: username, role: role}).promise .then((r) -> q.resolve r) .catch((e) -> q.reject (Bolt.constructResult e).data) q.promise diff --git a/app/scripts/services/UtilityREST.coffee b/app/scripts/services/UtilityREST.coffee index c52d6e6190e..c59fa54fc78 100644 --- a/app/scripts/services/UtilityREST.coffee +++ b/app/scripts/services/UtilityREST.coffee @@ -33,7 +33,7 @@ angular.module('neo4jApp.services') getUser: -> q = $q.defer() - Server.cypher('', { query: 'CALL dbms.showCurrentUser()'}).then( + Server.cypher('', { query: 'CALL dbms.security.showCurrentUser()'}).then( (res) -> data = res.data user = data.data[0] @@ -42,7 +42,7 @@ angular.module('neo4jApp.services') q.promise getUserList: -> q = $q.defer() - Server.cypher('', { query: 'CALL dbms.listUsers()'}).then( + Server.cypher('', { query: 'CALL dbms.security.listUsers()'}).then( (res) -> data = res.data users = data.data.map((user) -> @@ -58,7 +58,7 @@ angular.module('neo4jApp.services') getRolesList: -> q = $q.defer() - Server.cypher('', { query: 'CALL dbms.listRoles() YIELD role'}).then( + Server.cypher('', { query: 'CALL dbms.security.listRoles() YIELD role'}).then( (res) -> data = res.data users = data.data.map((v) -> v[0]) @@ -85,26 +85,26 @@ angular.module('neo4jApp.services') q.promise changeUserPassword: (username, password) -> - @callUserAdminProcedure("CALL dbms.changeUserPassword({username}, {password})", {username: username, password: password}) + @callUserAdminProcedure("CALL dbms.security.changeUserPassword({username}, {password})", {username: username, password: password}) addNewUser: (username, password, requirePasswordChange) -> - @callUserAdminProcedure("CALL dbms.createUser({username}, {password}, {requirePasswordChange})", {username: username, password: password, requirePasswordChange: requirePasswordChange}) + @callUserAdminProcedure("CALL dbms.security.createUser({username}, {password}, {requirePasswordChange})", {username: username, password: password, requirePasswordChange: requirePasswordChange}) suspendUser: (username) -> - @callUserAdminProcedure("CALL dbms.suspendUser({username})", {username: username}) + @callUserAdminProcedure("CALL dbms.security.suspendUser({username})", {username: username}) deleteUser: (username) -> - @callUserAdminProcedure("CALL dbms.deleteUser({username})", {username: username}) + @callUserAdminProcedure("CALL dbms.security.deleteUser({username})", {username: username}) activateUser: (username) -> - @callUserAdminProcedure("CALL dbms.activateUser({username})", {username: username}) + @callUserAdminProcedure("CALL dbms.security.activateUser({username})", {username: username}) addUserToRole: (username, role) -> - @callUserAdminProcedure("CALL dbms.addUserToRole({username}, {role})", {username: username, role:role}) + @callUserAdminProcedure("CALL dbms.security.addRoleToUser({role}, {username})", {username: username, role:role}) removeRoleFromUser: (username, role) -> - @callUserAdminProcedure("CALL dbms.removeUserFromRole({username}, {role})", {username: username, role:role}) + @callUserAdminProcedure("CALL dbms.security.removeRoleFromUser({role}, {username})", {username: username, role:role}) getProceduresList: -> q = $q.defer()