mitchell852 closed pull request #877: [Issue-876] - adds roles and capabilities 
tables to TP
URL: https://github.com/apache/incubator-trafficcontrol/pull/877
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_portal/app/src/app.js b/traffic_portal/app/src/app.js
index e2f44b3c56..1f61926066 100644
--- a/traffic_portal/app/src/app.js
+++ b/traffic_portal/app/src/app.js
@@ -167,6 +167,13 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./modules/private/monitor/dashboard/view').name,
         require('./modules/private/monitor/map').name,
 
+        // permissions
+        require('./modules/private/permissions').name,
+        require('./modules/private/permissions/capabilities').name,
+        require('./modules/private/permissions/capabilities/list').name,
+        require('./modules/private/permissions/roles').name,
+        require('./modules/private/permissions/roles/list').name,
+
         // tools
         require('./modules/private/tools').name,
         require('./modules/private/tools/iso').name,
@@ -244,6 +251,7 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./common/modules/table/cacheGroupParameters').name,
         require('./common/modules/table/cacheGroupServers').name,
         require('./common/modules/table/cacheGroupStaticDnsEntries').name,
+        require('./common/modules/table/capabilities').name,
         require('./common/modules/table/changeLogs').name,
         require('./common/modules/table/asns').name,
         require('./common/modules/table/cdns').name,
@@ -271,6 +279,7 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./common/modules/table/profiles').name,
         require('./common/modules/table/regions').name,
         require('./common/modules/table/regionPhysLocations').name,
+        require('./common/modules/table/roles').name,
         require('./common/modules/table/servers').name,
         require('./common/modules/table/serverDeliveryServices').name,
         require('./common/modules/table/statuses').name,
diff --git a/traffic_portal/app/src/common/api/CapabilityService.js 
b/traffic_portal/app/src/common/api/CapabilityService.js
new file mode 100644
index 0000000000..da8df4ffd1
--- /dev/null
+++ b/traffic_portal/app/src/common/api/CapabilityService.js
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+var CapabilityService = function(Restangular, messageModel) {
+
+       this.getCapabilities = function(queryParams) {
+               return Restangular.all('capabilities').getList(queryParams);
+       };
+
+       this.getCapability = function(id) {
+               return Restangular.one("capabilities", id).get();
+       };
+
+       this.updateCapability = function(capability) {
+               return capability.put()
+                       .then(
+                               function() {
+                                       messageModel.setMessages([ { level: 
'success', text: 'Capability updated' } ], false);
+                               },
+                               function(fault) {
+                                       
messageModel.setMessages(fault.data.alerts, false);
+                               }
+                       );
+       };
+
+       this.deleteCapability = function(capability) {
+               return capability.remove()
+                       .then(
+                               function() {
+                                       messageModel.setMessages([ { level: 
'success', text: 'Capability deleted' } ], true);
+                               },
+                               function(fault) {
+                                       
messageModel.setMessages(fault.data.alerts, true);
+                               }
+                       );
+       };
+
+};
+
+CapabilityService.$inject = ['Restangular', 'messageModel'];
+module.exports = CapabilityService;
diff --git a/traffic_portal/app/src/common/api/RoleService.js 
b/traffic_portal/app/src/common/api/RoleService.js
index bcd9b3bbcc..70b77bc6f2 100644
--- a/traffic_portal/app/src/common/api/RoleService.js
+++ b/traffic_portal/app/src/common/api/RoleService.js
@@ -39,8 +39,8 @@ var RoleService = function(Restangular, messageModel) {
         );
     };
 
-    this.deleteRole = function(id) {
-        return Restangular.one("roles", id).remove()
+    this.deleteRole = function(role) {
+        return role.remove()
             .then(
                 function() {
                     messageModel.setMessages([ { level: 'success', text: 'Role 
deleted' } ], true);
diff --git a/traffic_portal/app/src/common/api/index.js 
b/traffic_portal/app/src/common/api/index.js
index 969e52ad1e..55a06a097f 100644
--- a/traffic_portal/app/src/common/api/index.js
+++ b/traffic_portal/app/src/common/api/index.js
@@ -23,6 +23,7 @@ module.exports = angular.module('trafficPortal.api', [])
     .service('cacheGroupService', require('./CacheGroupService'))
     .service('cacheGroupParameterService', 
require('./CacheGroupParameterService'))
        .service('cacheStatsService', require('./CacheStatsService'))
+       .service('capabilityService', require('./CapabilityService'))
        .service('cdnService', require('./CDNService'))
     .service('changeLogService', require('./ChangeLogService'))
     .service('deliveryServiceService', require('./DeliveryServiceService'))
diff --git 
a/traffic_portal/app/src/common/modules/navigation/navigation.tpl.html 
b/traffic_portal/app/src/common/modules/navigation/navigation.tpl.html
index c0166903f3..06cd16ec00 100644
--- a/traffic_portal/app/src/common/modules/navigation/navigation.tpl.html
+++ b/traffic_portal/app/src/common/modules/navigation/navigation.tpl.html
@@ -54,6 +54,12 @@
                         <li class="side-menu-category-item" 
ng-class="{'current-page': isState('trafficPortal.private.admin.users')}"><a 
ng-click="navigateToPath('/admin/users')">Users</a></li>
                     </ul>
                 </li>
+                <li class="side-menu-category"><a 
href="javascript:void(0);"><i class="fa fa-sm fa-chevron-right"></i> 
Permissions</span></a>
+                    <ul class="nav child_menu" style="display: none">
+                        <li class="side-menu-category-item" 
ng-class="{'current-page': 
isState('trafficPortal.private.permissions.capabilities')}"><a 
ng-click="navigateToPath('/permissions/capabilities')">Capabilities</a></li>
+                        <li class="side-menu-category-item" 
ng-class="{'current-page': 
isState('trafficPortal.private.permissions.roles')}"><a 
ng-click="navigateToPath('/permissions/roles')">Roles</a></li>
+                    </ul>
+                </li>
                 <li class="side-menu-category"><a 
href="javascript:void(0);"><i class="fa fa-sm fa-chevron-right"></i> 
Tools</span></a>
                     <ul class="nav child_menu" style="display: none">
                         <li class="side-menu-category-item" 
ng-class="{'current-page': isState('trafficPortal.private.tools.iso')}"><a 
ng-click="navigateToPath('/tools/generate-iso')">Generate ISO</a></li>
diff --git 
a/traffic_portal/app/src/common/modules/table/capabilities/TableCapabilitiesController.js
 
b/traffic_portal/app/src/common/modules/table/capabilities/TableCapabilitiesController.js
new file mode 100644
index 0000000000..0184f41c23
--- /dev/null
+++ 
b/traffic_portal/app/src/common/modules/table/capabilities/TableCapabilitiesController.js
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+var TableCapabilitiesController = function(capabilities, $scope, $state) {
+
+       $scope.capabilities = capabilities;
+
+       $scope.refresh = function() {
+               $state.reload(); // reloads all the resolves for the view
+       };
+
+       angular.element(document).ready(function () {
+               $('#capabilitiesTable').dataTable({
+                       "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, 
"All"]],
+                       "iDisplayLength": 25,
+                       "aaSorting": []
+               });
+       });
+
+};
+
+TableCapabilitiesController.$inject = ['capabilities', '$scope', '$state'];
+module.exports = TableCapabilitiesController;
diff --git a/traffic_portal/app/src/common/modules/table/capabilities/index.js 
b/traffic_portal/app/src/common/modules/table/capabilities/index.js
new file mode 100644
index 0000000000..4a1f252a66
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/table/capabilities/index.js
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module.exports = angular.module('trafficPortal.table.capabilities', [])
+       .controller('TableCapabilitiesController', 
require('./TableCapabilitiesController'));
diff --git 
a/traffic_portal/app/src/common/modules/table/capabilities/table.capabilities.tpl.html
 
b/traffic_portal/app/src/common/modules/table/capabilities/table.capabilities.tpl.html
new file mode 100644
index 0000000000..bf43e04a30
--- /dev/null
+++ 
b/traffic_portal/app/src/common/modules/table/capabilities/table.capabilities.tpl.html
@@ -0,0 +1,50 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<div class="x_panel">
+    <div class="x_title">
+        <ol class="breadcrumb pull-left">
+            <li class="active">Capabilities</li>
+        </ol>
+        <div class="pull-right">
+            <button class="btn btn-default" title="Refresh" 
ng-click="refresh()"><i class="fa fa-refresh"></i></button>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+    <div class="x_content">
+        <br>
+        <table id="capabilitiesTable" class="table responsive-utilities 
jambo_table">
+            <thead>
+            <tr class="headings">
+                <th>name</th>
+                <th>description</th>
+            </tr>
+            </thead>
+            <tbody>
+            <tr ng-repeat="capability in ::capabilities">
+                <td>{{::capability.name}}</td>
+                <td>{{::capability.description}}</td>
+            </tr>
+            </tbody>
+        </table>
+    </div>
+</div>
+
+
+
diff --git 
a/traffic_portal/app/src/common/modules/table/roles/TableRolesController.js 
b/traffic_portal/app/src/common/modules/table/roles/TableRolesController.js
new file mode 100644
index 0000000000..22d3cb1574
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/table/roles/TableRolesController.js
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+var TableRolesController = function(roles, $scope, $state) {
+
+       $scope.roles = roles;
+
+       $scope.refresh = function() {
+               $state.reload(); // reloads all the resolves for the view
+       };
+
+       angular.element(document).ready(function () {
+               $('#rolesTable').dataTable({
+                       "aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, 
"All"]],
+                       "iDisplayLength": 25,
+                       "aaSorting": []
+               });
+       });
+
+};
+
+TableRolesController.$inject = ['roles', '$scope', '$state'];
+module.exports = TableRolesController;
diff --git a/traffic_portal/app/src/common/modules/table/roles/index.js 
b/traffic_portal/app/src/common/modules/table/roles/index.js
new file mode 100644
index 0000000000..b50b89f4d3
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/table/roles/index.js
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module.exports = angular.module('trafficPortal.table.roles', [])
+       .controller('TableRolesController', require('./TableRolesController'));
diff --git 
a/traffic_portal/app/src/common/modules/table/roles/table.roles.tpl.html 
b/traffic_portal/app/src/common/modules/table/roles/table.roles.tpl.html
new file mode 100644
index 0000000000..a3193a54a4
--- /dev/null
+++ b/traffic_portal/app/src/common/modules/table/roles/table.roles.tpl.html
@@ -0,0 +1,52 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<div class="x_panel">
+    <div class="x_title">
+        <ol class="breadcrumb pull-left">
+            <li class="active">Roles</li>
+        </ol>
+        <div class="pull-right">
+            <button class="btn btn-default" title="Refresh" 
ng-click="refresh()"><i class="fa fa-refresh"></i></button>
+        </div>
+        <div class="clearfix"></div>
+    </div>
+    <div class="x_content">
+        <br>
+        <table id="rolesTable" class="table responsive-utilities jambo_table">
+            <thead>
+            <tr class="headings">
+                <th>name</th>
+                <th>privilege level</th>
+                <th>description</th>
+            </tr>
+            </thead>
+            <tbody>
+            <tr ng-repeat="role in ::roles">
+                <td>{{::role.name}}</td>
+                <td>{{::role.privLevel}}</td>
+                <td>{{::role.description}}</td>
+            </tr>
+            </tbody>
+        </table>
+    </div>
+</div>
+
+
+
diff --git 
a/traffic_portal/app/src/modules/private/permissions/capabilities/capabilities.tpl.html
 
b/traffic_portal/app/src/modules/private/permissions/capabilities/capabilities.tpl.html
new file mode 100644
index 0000000000..4ad28d4a00
--- /dev/null
+++ 
b/traffic_portal/app/src/modules/private/permissions/capabilities/capabilities.tpl.html
@@ -0,0 +1,22 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<div id="capabilitiesContainer">
+    <div ui-view="capabilitiesContent"></div>
+</div>
diff --git 
a/traffic_portal/app/src/modules/private/permissions/capabilities/index.js 
b/traffic_portal/app/src/modules/private/permissions/capabilities/index.js
new file mode 100644
index 0000000000..33b2d768a9
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/permissions/capabilities/index.js
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module.exports = 
angular.module('trafficPortal.private.permissions.capabilities', [])
+       .config(function($stateProvider, $urlRouterProvider) {
+               $stateProvider
+                       
.state('trafficPortal.private.permissions.capabilities', {
+                               url: '/capabilities',
+                               abstract: true,
+                               views: {
+                                       permissionsContent: {
+                                               templateUrl: 
'modules/private/permissions/capabilities/capabilities.tpl.html'
+                                       }
+                               }
+                       })
+               ;
+               $urlRouterProvider.otherwise('/');
+       });
diff --git 
a/traffic_portal/app/src/modules/private/permissions/capabilities/list/index.js 
b/traffic_portal/app/src/modules/private/permissions/capabilities/list/index.js
new file mode 100644
index 0000000000..c7efb602d7
--- /dev/null
+++ 
b/traffic_portal/app/src/modules/private/permissions/capabilities/list/index.js
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module.exports = 
angular.module('trafficPortal.private.permissions.capabilities.list', [])
+       .config(function($stateProvider, $urlRouterProvider) {
+               $stateProvider
+                       
.state('trafficPortal.private.permissions.capabilities.list', {
+                               url: '',
+                               views: {
+                                       capabilitiesContent: {
+                                               templateUrl: 
'common/modules/table/capabilities/table.capabilities.tpl.html',
+                                               controller: 
'TableCapabilitiesController',
+                                               resolve: {
+                                                       capabilities: 
function(capabilityService) {
+                                                               return 
capabilityService.getCapabilities();
+                                                       }
+                                               }
+                                       }
+                               }
+                       })
+               ;
+               $urlRouterProvider.otherwise('/');
+       });
diff --git a/traffic_portal/app/src/modules/private/permissions/index.js 
b/traffic_portal/app/src/modules/private/permissions/index.js
new file mode 100644
index 0000000000..e08ff3520e
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/permissions/index.js
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module.exports = angular.module('trafficPortal.private.permissions', [])
+       .config(function($stateProvider, $urlRouterProvider) {
+               $stateProvider
+                       .state('trafficPortal.private.permissions', {
+                               url: 'permissions',
+                               abstract: true,
+                               views: {
+                                       privateContent: {
+                                               templateUrl: 
'modules/private/permissions/permissions.tpl.html'
+                                       }
+                               }
+                       });
+               $urlRouterProvider.otherwise('/');
+       });
diff --git 
a/traffic_portal/app/src/modules/private/permissions/permissions.tpl.html 
b/traffic_portal/app/src/modules/private/permissions/permissions.tpl.html
new file mode 100644
index 0000000000..1348f2f607
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/permissions/permissions.tpl.html
@@ -0,0 +1,22 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<div id="permissionsContainer">
+    <div ui-view="permissionsContent"></div>
+</div>
diff --git a/traffic_portal/app/src/modules/private/permissions/roles/index.js 
b/traffic_portal/app/src/modules/private/permissions/roles/index.js
new file mode 100644
index 0000000000..55f0f8d3db
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/permissions/roles/index.js
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module.exports = angular.module('trafficPortal.private.permissions.roles', [])
+       .config(function($stateProvider, $urlRouterProvider) {
+               $stateProvider
+                       .state('trafficPortal.private.permissions.roles', {
+                               url: '/roles',
+                               abstract: true,
+                               views: {
+                                       permissionsContent: {
+                                               templateUrl: 
'modules/private/permissions/roles/roles.tpl.html'
+                                       }
+                               }
+                       })
+               ;
+               $urlRouterProvider.otherwise('/');
+       });
diff --git 
a/traffic_portal/app/src/modules/private/permissions/roles/list/index.js 
b/traffic_portal/app/src/modules/private/permissions/roles/list/index.js
new file mode 100644
index 0000000000..e57be76177
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/permissions/roles/list/index.js
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+module.exports = 
angular.module('trafficPortal.private.permissions.roles.list', [])
+       .config(function($stateProvider, $urlRouterProvider) {
+               $stateProvider
+                       .state('trafficPortal.private.permissions.roles.list', {
+                               url: '',
+                               views: {
+                                       rolesContent: {
+                                               templateUrl: 
'common/modules/table/roles/table.roles.tpl.html',
+                                               controller: 
'TableRolesController',
+                                               resolve: {
+                                                       roles: 
function(roleService) {
+                                                               return 
roleService.getRoles({ orderby: 'priv_level DESC' });
+                                                       }
+                                               }
+                                       }
+                               }
+                       })
+               ;
+               $urlRouterProvider.otherwise('/');
+       });
diff --git 
a/traffic_portal/app/src/modules/private/permissions/roles/roles.tpl.html 
b/traffic_portal/app/src/modules/private/permissions/roles/roles.tpl.html
new file mode 100644
index 0000000000..7f9d903ce2
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/permissions/roles/roles.tpl.html
@@ -0,0 +1,22 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<div id="rolesContainer">
+    <div ui-view="rolesContent"></div>
+</div>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to