You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by MartinWeindel <gi...@git.apache.org> on 2015/10/09 16:43:44 UTC

[GitHub] incubator-zeppelin pull request: Added Shiro security

Github user MartinWeindel commented on the pull request:

    https://github.com/apache/incubator-zeppelin/pull/53#issuecomment-146892108
  
    @hayssams:
    There is a small bug, if you from a notebook to the home page by clicking on the top left Zeppelin link.
    In this case the user is set to anonymous.
    
    I suggest the patch below to fix this problem.
    
    ```
    diff --git a/zeppelin-web/src/app/home/home.controller.js b/zeppelin-web/src/app/home/home.controller.js
    index 1a20219..77f8185 100644
    --- a/zeppelin-web/src/app/home/home.controller.js
    +++ b/zeppelin-web/src/app/home/home.controller.js
    @@ -14,11 +14,13 @@
     'use strict';
     
     angular.module('zeppelinWebApp').controller('HomeCtrl', function($scope, notebookListDataFactory, websocketMsgSrv, $rootScope, arrayOrderingSrv) {
    -  $rootScope.ticket = {
    -    'principal':'anonymous',
    -    'ticket':'anonymous'
    -  };
    -
    +  if (!$rootScope.ticket) {
    +	  $rootScope.ticket = {
    +	    'principal':'anonymous',
    +	    'ticket':'anonymous'
    +	  };
    +  }
    +  
       var vm = this;
       vm.notes = notebookListDataFactory;
       vm.websocketMsgSrv = websocketMsgSrv;
    diff --git a/zeppelin-web/src/components/navbar/navbar.controller.js b/zeppelin-web/src/components/navbar/navbar.controller.js
    index 73be946..9be6b9b 100644
    --- a/zeppelin-web/src/components/navbar/navbar.controller.js
    +++ b/zeppelin-web/src/components/navbar/navbar.controller.js
    @@ -16,10 +16,12 @@
     'use strict';
     
     angular.module('zeppelinWebApp').controller('NavCtrl', function($scope, $rootScope, $routeParams, notebookListDataFactory, websocketMsgSrv, arrayOrderingSrv, $http) {
    -  $rootScope.ticket = {
    -    'principal':'anonymous',
    -    'ticket':'anonymous'
    -  };
    +  if (!$rootScope.ticket) {
    +	  $rootScope.ticket = {
    +			    'principal':'anonymous',
    +			    'ticket':'anonymous'
    +			  };
    +  }
       /** Current list of notes (ids) */
     
       var vm = this;
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---