graphdb-workbench 1.11.0-TR8 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{10.fb4f48b1f5de6ee87d6d.bundle.js → 10.f0277e5092cea150b5a8.bundle.js} +2 -2
- package/dist/10.f0277e5092cea150b5a8.bundle.js.map +1 -0
- package/dist/113.2c059fa7d06fd04149eb.bundle.js +1 -1
- package/dist/113.2c059fa7d06fd04149eb.bundle.js.map +1 -1
- package/dist/12.a3762f9fba854a28c1cb.bundle.js +2 -0
- package/dist/12.a3762f9fba854a28c1cb.bundle.js.map +1 -0
- package/dist/{14.0ae911933dceb9e81b71.bundle.js → 14.0c709b039159410b0b91.bundle.js} +3 -3
- package/dist/14.0c709b039159410b0b91.bundle.js.map +1 -0
- package/dist/141.5d76be84a3151e69fc9d.bundle.js +2 -0
- package/dist/141.5d76be84a3151e69fc9d.bundle.js.map +1 -0
- package/dist/{15.8883575d2b4b5d38f57c.bundle.js → 15.fc7c799455b5aec64393.bundle.js} +2 -2
- package/dist/15.fc7c799455b5aec64393.bundle.js.map +1 -0
- package/dist/{16.43d7529e9941193fa082.bundle.js → 16.005766c64d76f95231b1.bundle.js} +2 -2
- package/dist/16.005766c64d76f95231b1.bundle.js.map +1 -0
- package/dist/22.e85ffde858c596437b7a.bundle.js +1 -1
- package/dist/22.e85ffde858c596437b7a.bundle.js.map +1 -1
- package/dist/23.102a20601f717ba91551.bundle.js +2 -0
- package/dist/23.102a20601f717ba91551.bundle.js.map +1 -0
- package/dist/27.ab75434b1389b977291c.bundle.js +2 -0
- package/dist/27.ab75434b1389b977291c.bundle.js.map +1 -0
- package/dist/{28.d1475cfb4d1ea5f56ae9.bundle.js → 28.b2180a7cba95d9328e1a.bundle.js} +2 -2
- package/dist/28.b2180a7cba95d9328e1a.bundle.js.map +1 -0
- package/dist/30.d341c7532759bc79f41a.bundle.js +1 -1
- package/dist/30.d341c7532759bc79f41a.bundle.js.map +1 -1
- package/dist/37.dcbe2e4e1f86ca2da209.bundle.js +1 -1
- package/dist/37.dcbe2e4e1f86ca2da209.bundle.js.map +1 -1
- package/dist/38.171aa543e807777b4f29.bundle.js +1 -1
- package/dist/38.171aa543e807777b4f29.bundle.js.map +1 -1
- package/dist/5.21d2da4b4bc2b26e2534.bundle.js +2 -0
- package/dist/5.21d2da4b4bc2b26e2534.bundle.js.map +1 -0
- package/dist/79.f4a2c3ec71bed08d61b9.bundle.js +2 -0
- package/dist/79.f4a2c3ec71bed08d61b9.bundle.js.map +1 -0
- package/dist/81.c121539902986ebd8959.bundle.js +2 -0
- package/dist/81.c121539902986ebd8959.bundle.js.map +1 -0
- package/dist/{bundle.0a5b809c03f124aec6f7.bundle.js → bundle.26708524aa502d7fbb2a.bundle.js} +4 -4
- package/dist/bundle.26708524aa502d7fbb2a.bundle.js.map +1 -0
- package/dist/css/yasr.custom.css +2 -7
- package/dist/index.html +4 -4
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/security/templates/users.html +3 -3
- package/dist/{main.01737460d2ccec50cfc4.css → main.f3ac7a31928cc9e47a4c.css} +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/clusterInfo.html +1 -1
- package/dist/pages/create-index.html +4 -4
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +11 -11
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/import.html +1 -1
- package/dist/pages/jdbc-create.html +5 -5
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +2 -2
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +2 -2
- package/dist/pages/repository.html +2 -2
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-template-create.html +5 -5
- package/dist/pages/sparql.html +3 -3
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger/index.html +25 -25
- package/package.json +1 -1
- package/dist/10.fb4f48b1f5de6ee87d6d.bundle.js.map +0 -1
- package/dist/12.5d4da897bdd91e8808fa.bundle.js +0 -2
- package/dist/12.5d4da897bdd91e8808fa.bundle.js.map +0 -1
- package/dist/14.0ae911933dceb9e81b71.bundle.js.map +0 -1
- package/dist/141.2e6396a7a61e3d67d5ef.bundle.js +0 -2
- package/dist/141.2e6396a7a61e3d67d5ef.bundle.js.map +0 -1
- package/dist/15.8883575d2b4b5d38f57c.bundle.js.map +0 -1
- package/dist/16.43d7529e9941193fa082.bundle.js.map +0 -1
- package/dist/23.22a2c7a5fbda4adef434.bundle.js +0 -2
- package/dist/23.22a2c7a5fbda4adef434.bundle.js.map +0 -1
- package/dist/27.cff13773d20413d9c0ca.bundle.js +0 -2
- package/dist/27.cff13773d20413d9c0ca.bundle.js.map +0 -1
- package/dist/28.d1475cfb4d1ea5f56ae9.bundle.js.map +0 -1
- package/dist/5.8d845598787fc1d3d593.bundle.js +0 -2
- package/dist/5.8d845598787fc1d3d593.bundle.js.map +0 -1
- package/dist/79.341155954566d12243c5.bundle.js +0 -2
- package/dist/79.341155954566d12243c5.bundle.js.map +0 -1
- package/dist/81.cdab77c0ab1e18aa9929.bundle.js +0 -2
- package/dist/81.cdab77c0ab1e18aa9929.bundle.js.map +0 -1
- package/dist/bundle.0a5b809c03f124aec6f7.bundle.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["webpack:///./src/js/angular/security/controllers.js"],"names":["securityCtrl","angular","module","parseAuthorities","authorities","userType","USER","grantedAuthorities","repositories","i","length","role","ROLE_ADMIN","ADMIN","ROLE_REPO_MANAGER","REPO_MANAGER","ROLE_USER","indexOf","index","op","substr","repo","read","write","userTypeDescription","getUserRoleName","controller","$scope","$http","toastr","$jwtAuth","$openIDAuth","$location","$rootScope","username","password","loginWithOpenID","loginOpenID","search","noaccess","error","expired","isGDBLoginEnabled","passwordLoginEnabled","isOpenIDEnabled","openIDEnabled","login","method","url","encodeURIComponent","headers","success","data","status","authenticate","then","returnToUrl","path","wrongCredentials","msg","getError","$modal","$window","$timeout","ModalService","SecurityRestService","loader","securityEnabled","isSecurityEnabled","hasExternalAuth","getAuthImplementation","freeAccessEnabled","isFreeAccessEnabled","getUsers","users","pa","$on","toggleSecurity","timer","location","reload","cancel","toggleFreeAccess","updateFreeAccess","getFreeAccess","res","appSettings","open","templateUrl","resolve","defaultAuthorities","repoIds","_","mapKeys","getRepositories","r","id","each","a","hasOwnProperty","result","editFreeAccess","removeUser","openSimpleModal","title","message","warning","deleteUser","name","$modalInstance","hasActiveLocation","isEmpty","globalLocation","globalRepositories","ok","auth","repositoryCheckError","WRITE_REPO","push","READ_REPO","close","dismiss","isAdmin","hasRole","hasEditRestrictions","user","isOverrideAuth","isDefaultAuthEnabled","setGrantedAuthorities","pushAuthority","arguments","authority","hasReadPermission","repositoryId","hasWritePermission","readCheckDisabled","writeCheckDisabled","validatePassword","noPassword","passwordError","confirmPasswordError","confirmpassword","isLocalAuthentication","updateUser","validateForm","updateUserHttp","setNoPassword","$controller","extend","this","mode","saveButtonText","goBack","history","back","pageTitle","passwordPlaceholder","submit","createUser","createUserHttp","pass","usernameError","$routeParams","params","userId","defaultUserSettings","getUserData","getUser","userData","external","undefined","getPrincipal","debugMapping","mapping","split","getRolesMapping","getRoles","roleMappings","roles","keys","mappings","permissionsCount","map","filter","reverse","orderBy","p","currentUserData","updateCurrentUserData","assign","redirectAdmin","redirectToLogin","initUserData","scope","copy","currentScope","updateUserData"],"mappings":"0FAAA,wCAMA,MAeMA,EAAeC,QAAQC,OAAO,yCATpB,CACZ,YACA,eACA,0CACA,gDACA,0CACA,WA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eACR,OAAO,EAGXrH,EAAOsH,kBAGXtH,EAAOqH,aAAe,WAClB,OAAOrH,EAAO8G,uBAI1BzI,EAAa0B,WAAW,iBAAkB,CAAC,SAAU,iBAAkB,WAAY,SAAUC,EAAQkF,EAAgB3E,GACjHP,EAAOO,SAAWA,EAElBP,EAAOuF,GAAK,WACRL,EAAeW,SAGnB7F,EAAOsD,OAAS,WACZ4B,EAAeY,QAAQ","file":"12.a3762f9fba854a28c1cb.bundle.js","sourcesContent":["import 'angular/core/services';\nimport 'angular/core/services/jwt-auth.service';\nimport 'angular/core/services/openid-auth.service';\nimport 'angular/rest/security.rest.service';\nimport {UserUtils, UserRole, UserType} from 'angular/utils/user-utils';\n\nconst SYSTEM_REPO = 'SYSTEM';\nconst READ_REPO = 'READ_REPO';\nconst READ_REPO_PREFIX = 'READ_REPO_';\nconst WRITE_REPO = 'WRITE_REPO';\nconst WRITE_REPO_PREFIX = 'WRITE_REPO_';\n\nconst modules = [\n 'ngCookies',\n 'ui.bootstrap',\n 'graphdb.framework.core.services.jwtauth',\n 'graphdb.framework.core.services.openIDService',\n 'graphdb.framework.rest.security.service',\n 'toastr'\n];\n\nconst securityCtrl = angular.module('graphdb.framework.security.controllers', modules);\n\nconst setGrantedAuthorities = function ($scope) {\n function pushAuthority() {\n for (let i = 0; i < arguments.length; i++) {\n const authority = arguments[i];\n if (_.indexOf($scope.user.grantedAuthorities, authority) < 0) {\n $scope.user.grantedAuthorities.push(authority);\n }\n }\n }\n\n $scope.user.grantedAuthorities = [];\n\n $scope.repositoryCheckError = true;\n if ($scope.userType === UserType.ADMIN) {\n $scope.repositoryCheckError = false;\n pushAuthority(UserRole.ROLE_ADMIN);\n } else if ($scope.userType === UserType.REPO_MANAGER) {\n $scope.repositoryCheckError = false;\n pushAuthority(UserRole.ROLE_REPO_MANAGER);\n } else {\n pushAuthority(UserRole.ROLE_USER);\n for (const index in $scope.grantedAuthorities.WRITE_REPO) {\n if ($scope.grantedAuthorities.WRITE_REPO[index]) {\n $scope.repositoryCheckError = false;\n pushAuthority(WRITE_REPO_PREFIX + index, READ_REPO_PREFIX + index);\n }\n }\n for (const index in $scope.grantedAuthorities.READ_REPO) {\n if ($scope.grantedAuthorities.READ_REPO[index]) {\n $scope.repositoryCheckError = false;\n pushAuthority(READ_REPO_PREFIX + index);\n }\n }\n }\n};\n\nconst parseAuthorities = function (authorities) {\n let userType = UserType.USER;\n const grantedAuthorities = {\n [READ_REPO]: {},\n [WRITE_REPO]: {}\n };\n const repositories = {};\n for (let i = 0; i < authorities.length; i++) {\n const role = authorities[i];\n if (role === UserRole.ROLE_ADMIN) {\n userType = UserType.ADMIN;\n } else if (role === UserRole.ROLE_REPO_MANAGER) {\n if (userType !== UserType.ADMIN) {\n userType = UserType.REPO_MANAGER;\n }\n } else if (role === UserRole.ROLE_USER) {\n userType = UserType.USER;\n } else if (role.indexOf('ROLE_') !== 0) {\n const index = role.indexOf('_', role.indexOf('_') + 1);\n const op = role.substr(0, index);\n const repo = role.substr(index + 1);\n grantedAuthorities[op][repo] = true;\n repositories[repo] = repositories[repo] || {};\n if (op === READ_REPO) {\n repositories[repo].read = true;\n } else if (op === WRITE_REPO) {\n repositories[repo].write = true;\n }\n }\n }\n\n return {\n userType: userType,\n userTypeDescription: UserUtils.getUserRoleName(userType),\n grantedAuthorities: grantedAuthorities,\n repositories: repositories\n };\n};\n\nsecurityCtrl.controller('LoginCtrl', ['$scope', '$http', 'toastr', '$jwtAuth', '$openIDAuth', '$location', '$rootScope',\n function ($scope, $http, toastr, $jwtAuth, $openIDAuth, $location, $rootScope) {\n $scope.username = '';\n $scope.password = '';\n\n $scope.loginWithOpenID = function() {\n $jwtAuth.loginOpenID();\n };\n\n if ($location.search().noaccess) {\n toastr.error('User has no access rights or configuration error.', 'Login error');\n } else if ($location.search().expired) {\n toastr.error('Your authentication token has expired. Please login again.', 'Login error');\n }\n\n $scope.isGDBLoginEnabled = function() {\n return $jwtAuth.passwordLoginEnabled;\n };\n\n $scope.isOpenIDEnabled = function() {\n return $jwtAuth.openIDEnabled;\n };\n\n $scope.login = function () {\n return $http({\n method: 'POST',\n url: 'rest/login/' + encodeURIComponent($scope.username),\n headers: {\n 'X-GraphDB-Password': $scope.password\n }\n }).success(function (data, status, headers) {\n $jwtAuth.authenticate(data, headers('Authorization'))\n .then(() => {\n if ($rootScope.returnToUrl) {\n // go back to remembered url\n $location.url($rootScope.returnToUrl);\n } else {\n // no remembered url, go to home\n $location.path('/');\n }\n });\n }).error(function (data, status) {\n if (status === 401) {\n toastr.error('Wrong credentials!', 'Error');\n $scope.wrongCredentials = true;\n $scope.username = '';\n $scope.password = '';\n } else {\n const msg = getError(data);\n toastr.error(msg, status);\n }\n });\n };\n }]);\n\nsecurityCtrl.controller('UsersCtrl', ['$scope', '$modal', 'toastr', '$window', '$jwtAuth', '$timeout', 'ModalService', 'SecurityRestService',\n function ($scope, $modal, toastr, $window, $jwtAuth, $timeout, ModalService, SecurityRestService) {\n\n $scope.loader = true;\n $scope.securityEnabled = function () {\n return $jwtAuth.isSecurityEnabled();\n };\n $scope.hasExternalAuth = function () {\n return $jwtAuth.hasExternalAuth();\n };\n $scope.getAuthImplementation = function () {\n return $jwtAuth.getAuthImplementation();\n };\n $scope.freeAccessEnabled = function () {\n return $jwtAuth.isFreeAccessEnabled();\n };\n $scope.getUsers = function () {\n SecurityRestService.getUsers()\n .success(function (data) {\n $scope.users = data;\n for (let i = 0; i < $scope.users.length; i++) {\n const pa = parseAuthorities($scope.users[i].grantedAuthorities);\n $scope.users[i].userType = pa.userType;\n $scope.users[i].userTypeDescription = pa.userTypeDescription;\n $scope.users[i].repositories = pa.repositories;\n }\n $scope.loader = false;\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, 'Error');\n $scope.loader = false;\n });\n };\n $scope.getUsers();\n\n $scope.$on('repositoryIsSet', function () {\n $scope.getUsers();\n });\n\n $scope.toggleSecurity = function () {\n $jwtAuth.toggleSecurity(!$jwtAuth.isSecurityEnabled());\n if ($jwtAuth.isSecurityEnabled()) {\n const timer = $timeout(function () {\n $window.location.reload();\n }, 500);\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n }\n };\n\n $scope.toggleFreeAccess = function (updateFreeAccess) {\n if (!$jwtAuth.isFreeAccessEnabled() || ($jwtAuth.isFreeAccessEnabled() && updateFreeAccess)) {\n SecurityRestService.getFreeAccess().then(function (res) {\n let authorities = res.data.authorities;\n let appSettings = res.data.appSettings || {\n 'DEFAULT_SAMEAS': true,\n 'DEFAULT_INFERENCE': true,\n 'EXECUTE_COUNT': true,\n 'IGNORE_SHARED_QUERIES': false,\n 'DEFAULT_VIS_GRAPH_SCHEMA': true\n };\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/security/templates/modal/default-authorities.html',\n controller: 'DefaultAuthoritiesCtrl',\n resolve: {\n data: function () {\n return {\n // converts the array rights to hash ones. why, oh, why do we have both formats?\n defaultAuthorities: function () {\n const defaultAuthorities = {\n [READ_REPO]: {},\n [WRITE_REPO]: {}\n };\n // We might have old (no longer existing) repositories so we have to check that\n const repoIds = _.mapKeys($scope.getRepositories(), function (r) {\n return r.id;\n });\n _.each(authorities, function (a) {\n // indexOf works in IE 11, startsWith doesn't\n if (a.indexOf(WRITE_REPO_PREFIX) === 0) {\n if (repoIds.hasOwnProperty(a.substr(11))) {\n defaultAuthorities[WRITE_REPO][a.substr(11)] = true;\n }\n } else if (a.indexOf(READ_REPO_PREFIX) === 0) {\n if (repoIds.hasOwnProperty(a.substr(10))) {\n defaultAuthorities[READ_REPO][a.substr(10)] = true;\n }\n }\n });\n return defaultAuthorities;\n },\n appSettings: appSettings\n };\n }\n }\n });\n modalInstance.result.then(function (data) {\n authorities = data.authorities;\n appSettings = data.appSettings;\n $jwtAuth.toggleFreeAccess(updateFreeAccess || !$jwtAuth.isFreeAccessEnabled(), authorities, appSettings, updateFreeAccess);\n });\n });\n } else {\n $jwtAuth.toggleFreeAccess(!$jwtAuth.isFreeAccessEnabled(), []);\n }\n };\n\n $scope.editFreeAccess = function () {\n $scope.toggleFreeAccess(true);\n };\n\n $scope.removeUser = function (username) {\n ModalService.openSimpleModal({\n title: 'Confirm delete',\n message: 'Are you sure you want to delete the user \\'' + username + '\\'?',\n warning: true\n }).result.then(function () {\n $scope.loader = true;\n SecurityRestService.deleteUser(username).success(function () {\n $scope.getUsers();\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, 'Error');\n\n $scope.loader = false;\n });\n\n });\n };\n\n // Should be able to send the original username to $routeParams\n $scope.encodeURIComponent = function (name) {\n return encodeURIComponent(name);\n };\n }]);\n\nsecurityCtrl.controller('DefaultAuthoritiesCtrl', ['$scope', '$http', '$modalInstance', 'data', '$rootScope',\n function ($scope, $http, $modalInstance, data, $rootScope) {\n $scope.grantedAuthorities = data.defaultAuthorities();\n $scope.appSettings = data.appSettings;\n\n $scope.hasActiveLocation = function () {\n // Hack to get this from root scope to avoid cyclic dependency\n return !_.isEmpty($rootScope.globalLocation);\n };\n\n $scope.getRepositories = function () {\n // Hack to get this from root scope to avoid cyclic dependency\n return $rootScope.globalRepositories;\n };\n\n $scope.ok = function () {\n const auth = [];\n $scope.repositoryCheckError = true;\n for (const index in $scope.grantedAuthorities.WRITE_REPO) {\n if ($scope.grantedAuthorities.WRITE_REPO[index]) {\n auth.push(WRITE_REPO_PREFIX + index);\n auth.push(READ_REPO_PREFIX + index);\n $scope.repositoryCheckError = false;\n }\n }\n for (const index in $scope.grantedAuthorities.READ_REPO) {\n if ($scope.grantedAuthorities.READ_REPO[index] && auth.indexOf(READ_REPO_PREFIX + index) === -1) {\n auth.push(READ_REPO_PREFIX + index);\n $scope.repositoryCheckError = false;\n }\n }\n if (!$scope.repositoryCheckError) {\n $modalInstance.close({authorities: auth, appSettings: $scope.appSettings});\n }\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n }]);\n\nsecurityCtrl.controller('CommonUserCtrl', ['$scope', '$http', 'toastr', '$window', '$timeout', '$location', '$jwtAuth',\n function ($scope, $http, toastr, $window, $timeout, $location, $jwtAuth) {\n\n $scope.isAdmin = function () {\n return $jwtAuth.hasRole(UserRole.ROLE_ADMIN);\n };\n $scope.hasExternalAuth = function () {\n return $jwtAuth.hasExternalAuth();\n };\n\n $scope.hasEditRestrictions = function () {\n return $scope.user && $scope.user.username === UserType.ADMIN;\n };\n\n $scope.isOverrideAuth = function () {\n return $jwtAuth.isDefaultAuthEnabled();\n };\n\n $scope.setGrantedAuthorities = function () {\n setGrantedAuthorities($scope);\n };\n\n $scope.hasReadPermission = function (repositoryId) {\n return $scope.userType === UserType.ADMIN || $scope.userType === UserType.REPO_MANAGER\n || $scope.grantedAuthorities.READ_REPO[repositoryId]\n || $scope.grantedAuthorities.WRITE_REPO[repositoryId]\n || repositoryId !== SYSTEM_REPO\n && ($scope.grantedAuthorities.READ_REPO['*'] || $scope.grantedAuthorities.WRITE_REPO['*']);\n };\n\n $scope.hasWritePermission = function (repositoryId) {\n return $scope.userType === UserType.ADMIN || $scope.userType === UserType.REPO_MANAGER\n || $scope.grantedAuthorities.WRITE_REPO[repositoryId]\n || repositoryId !== SYSTEM_REPO && $scope.grantedAuthorities.WRITE_REPO['*'];\n };\n\n $scope.readCheckDisabled = function (repositoryId) {\n return $scope.hasWritePermission(repositoryId)\n || repositoryId !== SYSTEM_REPO && repositoryId !== '*' && $scope.grantedAuthorities.READ_REPO['*']\n || $scope.hasEditRestrictions();\n };\n\n $scope.writeCheckDisabled = function (repositoryId) {\n return $scope.userType === UserType.ADMIN || $scope.userType === UserType.REPO_MANAGER\n || repositoryId !== SYSTEM_REPO && repositoryId !== '*' && $scope.grantedAuthorities.WRITE_REPO['*']\n || $scope.hasEditRestrictions();\n };\n\n $scope.userType = UserType.USER;\n $scope.grantedAuthorities = {\n [READ_REPO]: {},\n [WRITE_REPO]: {}\n };\n\n $scope.validatePassword = function() {\n if ($scope.noPassword) {\n $scope.passwordError = '';\n $scope.confirmPasswordError = '';\n return true;\n }\n if ($scope.user.password !== $scope.user.confirmpassword) {\n if (!$scope.user.password) {\n $scope.passwordError = 'Enter password!';\n $scope.confirmPasswordError = '';\n } else {\n $scope.passwordError = '';\n $scope.confirmPasswordError = 'Confirm password!';\n }\n return false;\n } else {\n $scope.passwordError = '';\n $scope.confirmPasswordError = '';\n }\n return true;\n };\n\n $scope.isLocalAuthentication = function() {\n return $jwtAuth.getAuthImplementation() === 'Local';\n };\n\n $scope.updateUser = function () {\n if (!$scope.validateForm()) {\n return false;\n }\n\n if ($scope.isLocalAuthentication()) {\n $scope.setGrantedAuthorities();\n }\n\n if (!$scope.repositoryCheckError) {\n $scope.updateUserHttp();\n }\n };\n\n $scope.setNoPassword = function() {\n if ($scope.noPassword) {\n $scope.user.password = '';\n $scope.user.confirmpassword = '';\n $scope.passwordError = '';\n $scope.confirmPasswordError = '';\n }\n }\n }]);\n\nsecurityCtrl.controller('AddUserCtrl', ['$scope', '$http', 'toastr', '$window', '$timeout', '$location', '$jwtAuth', '$controller', 'SecurityRestService', 'ModalService',\n function ($scope, $http, toastr, $window, $timeout, $location, $jwtAuth, $controller, SecurityRestService, ModalService) {\n\n angular.extend(this, $controller('CommonUserCtrl', {$scope: $scope}));\n\n $scope.mode = 'add';\n $scope.saveButtonText = 'Create';\n $scope.goBack = function () {\n const timer = $timeout(function () {\n $window.history.back();\n }, 100);\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n };\n $scope.pageTitle = 'Create new user';\n $scope.passwordPlaceholder = 'Password';\n\n $scope.user = {\n 'username': '',\n 'password': '',\n 'confirmpassword': '',\n 'grantedAuthorities': [],\n 'appSettings': {\n 'DEFAULT_SAMEAS': true,\n 'DEFAULT_INFERENCE': true,\n 'EXECUTE_COUNT': true,\n 'IGNORE_SHARED_QUERIES': false,\n 'DEFAULT_VIS_GRAPH_SCHEMA': true\n }\n };\n\n $scope.submit = function () {\n if ($scope.noPassword && $scope.userType === UserType.ADMIN) {\n ModalService.openSimpleModal({\n title: 'Create administrator',\n message: 'If the password is unset and security is enabled, this administrator will not be ' +\n 'able to log into GraphDB through the workbench. Are you sure that you want to continue?',\n warning: true\n }).result.then(function () {\n $scope.createUser();\n });\n } else {\n $scope.createUser();\n }\n };\n\n $scope.createUserHttp = function () {\n $scope.loader = true;\n SecurityRestService.createUser({\n username: $scope.user.username,\n pass: $scope.user.password,\n appSettings: $scope.user.appSettings,\n grantedAuthorities: $scope.user.grantedAuthorities\n }).success(function () {\n toastr.success('The user ' + $scope.user.username + ' has been created.');\n const timer = $timeout(function () {\n $scope.loader = false;\n $window.history.back();\n }, 2000);\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n }).error(function (data) {\n const msg = getError(data);\n $scope.loader = false;\n toastr.error(msg, 'Error');\n });\n };\n\n $scope.createUser = function () {\n if ($scope.validateForm()) {\n $scope.setGrantedAuthorities();\n\n if (!$scope.repositoryCheckError) {\n $scope.createUserHttp();\n }\n }\n };\n\n $scope.validateForm = function () {\n let result = true;\n if (!$scope.user.username) {\n $scope.usernameError = 'Enter username!';\n result = false;\n } else {\n $scope.usernameError = '';\n }\n if ($scope.noPassword) {\n $scope.passwordError = '';\n $scope.confirmPasswordError = '';\n } else {\n if (!$scope.user.password) {\n $scope.passwordError = 'Enter password!';\n result = false;\n } else {\n $scope.passwordError = '';\n }\n if (!$scope.user.confirmpassword || $scope.user.password !== $scope.user.confirmpassword) {\n $scope.confirmPasswordError = 'Confirm password!';\n result = false;\n } else {\n $scope.confirmPasswordError = '';\n }\n }\n\n return result;\n };\n }]);\n\nsecurityCtrl.controller('EditUserCtrl', ['$scope', '$http', 'toastr', '$window', '$routeParams', '$timeout', '$location', '$jwtAuth', '$controller', 'SecurityRestService', 'ModalService',\n function ($scope, $http, toastr, $window, $routeParams, $timeout, $location, $jwtAuth, $controller, SecurityRestService, ModalService) {\n\n angular.extend(this, $controller('CommonUserCtrl', {$scope: $scope}));\n\n $scope.mode = 'edit';\n $scope.saveButtonText = 'Save';\n $scope.goBack = function () {\n const timer = $timeout(function () {\n $window.history.back();\n }, 100);\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n };\n $scope.params = $routeParams;\n $scope.pageTitle = 'Edit user: ' + $scope.params.userId;\n $scope.passwordPlaceholder = 'New password';\n $scope.userType = UserType.USER;\n const defaultUserSettings = {\n 'DEFAULT_SAMEAS': true,\n 'DEFAULT_INFERENCE': true,\n 'EXECUTE_COUNT': true,\n 'IGNORE_SHARED_QUERIES': false,\n 'DEFAULT_VIS_GRAPH_SCHEMA': true\n };\n\n if (!$jwtAuth.hasRole(UserRole.ROLE_ADMIN)) {\n $location.url('settings');\n }\n $scope.getUserData = function () {\n SecurityRestService.getUser($scope.params.userId).success(function (data) {\n $scope.userData = data;\n $scope.user = {username: $scope.userData.username};\n $scope.user.password = '';\n $scope.user.confirmpassword = '';\n $scope.user.external = $scope.userData.external;\n $scope.user.appSettings = data.appSettings || defaultUserSettings;\n $scope.userType = UserType.USER;\n const pa = parseAuthorities(data.grantedAuthorities);\n $scope.userType = pa.userType;\n $scope.grantedAuthorities = pa.grantedAuthorities;\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, 'Error');\n });\n };\n\n $scope.getUserData();\n\n $scope.submit = function () {\n if ($scope.noPassword && $scope.userType === UserType.ADMIN) {\n ModalService.openSimpleModal({\n title: 'Save administrator settings',\n message: 'If you unset the password and then enable security, this administrator will not be ' +\n 'able to log into GraphDB through the workbench. Are you sure that you want to continue?',\n warning: true\n }).result.then(function () {\n $scope.updateUser();\n });\n } else {\n $scope.updateUser();\n }\n };\n\n $scope.updateUserHttp = function () {\n $scope.loader = true;\n SecurityRestService.updateUser({\n username: $scope.user.username,\n pass: ($scope.noPassword) ? '' : $scope.user.password || undefined,\n appSettings: $scope.user.appSettings,\n grantedAuthorities: $scope.user.grantedAuthorities\n }).success(function () {\n toastr.success('The user ' + $scope.user.username + ' was updated.');\n const timer = $timeout(function () {\n $scope.loader = false;\n $window.history.back();\n }, 2000);\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n // if we update the settings of the currently logged user, update the principal\n if ($scope.user.username === $jwtAuth.getPrincipal().username) {\n $jwtAuth.getPrincipal().appSettings = $scope.user.appSettings;\n }\n }).error(function (data) {\n const msg = getError(data);\n $scope.loader = false;\n toastr.error(msg, 'Error');\n });\n };\n\n $scope.validateForm = function () {\n return $scope.validatePassword();\n };\n }]);\n\nsecurityCtrl.controller('RolesMappingController', ['$scope', 'toastr', 'SecurityRestService',\n function ($scope, toastr, SecurityRestService) {\n\n $scope.debugMapping = function (role, mapping) {\n const method = mapping.split(':');\n SecurityRestService.getRolesMapping({\n role: role,\n method: method[1],\n mapping: method[0]\n });\n };\n\n const loadRoles = function () {\n SecurityRestService.getRoles()\n .success(function (data) {\n $scope.roleMappings = data;\n $scope.roles = _.keys($scope.roleMappings);\n $scope.mappings = _.keys($scope.roleMappings[$scope.roles[0]]);\n const permissionsCount = _.map($scope.roles, function (role) {\n return [role, _.filter($scope.roleMappings[role]).length];\n });\n $scope.roles = _.reverse(_.map(_.orderBy(permissionsCount, function (p) {\n return p[1];\n }), function (p) {\n return p[0];\n }));\n })\n .error(function (data) {\n const msg = getError(data);\n $scope.loader = false;\n toastr.error(msg, 'Error');\n });\n };\n\n $scope.$on('repositoryIsSet', function () {\n loadRoles();\n });\n}]);\n\nsecurityCtrl.controller('ChangeUserPasswordSettingsCtrl', ['$scope', 'toastr', '$window', '$timeout', '$jwtAuth', '$rootScope', '$controller', 'SecurityRestService', 'ModalService',\n function ($scope, toastr, $window, $timeout, $jwtAuth, $rootScope, $controller, SecurityRestService, ModalService) {\n\n angular.extend(this, $controller('CommonUserCtrl', {$scope: $scope}));\n\n $scope.mode = 'settings';\n $scope.hasEditRestrictions = function () {\n return true;\n };\n $scope.saveButtonText = 'Save';\n $scope.goBack = function () {\n const timer = $timeout(function () {\n $window.history.back();\n }, 100);\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n };\n $scope.currentUserData = function () {\n return $jwtAuth.getPrincipal();\n };\n\n $scope.updateCurrentUserData = function () {\n _.assign($jwtAuth.getPrincipal(), $scope.userData);\n };\n\n //call it as a function so I can make test on it\n $scope.redirectAdmin = function () {\n if (!$scope.currentUserData()) {\n $rootScope.redirectToLogin();\n }\n };\n\n $scope.pageTitle = 'Settings';\n $scope.passwordPlaceholder = 'New password';\n $scope.grantedAuthorities = {\n [READ_REPO]: {},\n [WRITE_REPO]: {}\n };\n\n const initUserData = function (scope) {\n // Copy needed so that Cancel would work correctly, need to call updateCurrentUserData on OK\n scope.userData = angular.copy(scope.currentUserData());\n scope.user = {username: scope.userData.username};\n scope.user.password = '';\n scope.user.confirmpassword = '';\n scope.user.external = scope.userData.external;\n scope.user.appSettings = scope.userData.appSettings;\n // For backward compatibility\n if (scope.user.appSettings['DEFAULT_VIS_GRAPH_SCHEMA'] === undefined) {\n scope.user.appSettings['DEFAULT_VIS_GRAPH_SCHEMA'] = true;\n }\n\n const pa = parseAuthorities(scope.userData.authorities);\n $scope.userType = pa.userType;\n $scope.grantedAuthorities = pa.grantedAuthorities;\n };\n\n if ($scope.currentUserData()) {\n initUserData($scope);\n } else {\n $scope.$on('securityInit', function (scope) {\n scope.currentScope.redirectAdmin();\n initUserData(scope.currentScope);\n });\n }\n\n $scope.loader = false;\n\n $scope.submit = function () {\n if ($scope.noPassword && $scope.userType === UserType.ADMIN) {\n ModalService.openSimpleModal({\n title: 'Save administrator settings',\n message: 'If you unset the password and then enable security, this administrator will not be ' +\n 'able to log into GraphDB through the workbench. Are you sure that you want to continue?',\n warning: true\n }).result.then(function () {\n $scope.updateUser();\n });\n } else {\n $scope.updateUser();\n }\n }\n\n $scope.updateUserHttp = function () {\n $scope.loader = true;\n SecurityRestService.updateUserData({\n username: $scope.user.username,\n pass: ($scope.noPassword) ? '' : $scope.user.password || undefined,\n appSettings: $scope.user.appSettings\n }).success(function () {\n $scope.updateCurrentUserData();\n toastr.success('The user ' + $scope.user.username + ' was updated.');\n const timer = $timeout(function () {\n $scope.loader = false;\n $window.history.back();\n }, 2000);\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n }).error(function (data) {\n const msg = getError(data);\n $scope.loader = false;\n toastr.error(msg, 'Error');\n });\n };\n\n $scope.updateUser = function () {\n if (!$scope.validateForm()) {\n return false;\n }\n\n $scope.updateUserHttp();\n };\n\n $scope.validateForm = function () {\n return $scope.validatePassword();\n };\n }]);\n\nsecurityCtrl.controller('DeleteUserCtrl', ['$scope', '$modalInstance', 'username', function ($scope, $modalInstance, username) {\n $scope.username = username;\n\n $scope.ok = function () {\n $modalInstance.close();\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}]);\n"],"sourceRoot":""}
|