You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/04/04 16:32:09 UTC

[GitHub] dewrich closed pull request #1911: Adds roles and capabilities tables to TP

dewrich closed pull request #1911: Adds roles and capabilities tables to TP
URL: https://github.com/apache/incubator-trafficcontrol/pull/1911
 
 
   

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 d5530d59c..c929bda53 100644
--- a/traffic_portal/app/src/app.js
+++ b/traffic_portal/app/src/app.js
@@ -59,6 +59,8 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./modules/private/cacheGroups/staticDnsEntries').name,
         require('./modules/private/cacheChecks').name,
         require('./modules/private/cacheStats').name,
+        require('./modules/private/capabilities').name,
+        require('./modules/private/capabilities/list').name,
         require('./modules/private/cdns').name,
         require('./modules/private/cdns/config').name,
         require('./modules/private/cdns/deliveryServices').name,
@@ -141,6 +143,8 @@ var trafficPortal = angular.module('trafficPortal', [
         require('./modules/private/regions/list').name,
         require('./modules/private/regions/physLocations').name,
         require('./modules/private/regions/new').name,
+        require('./modules/private/roles').name,
+        require('./modules/private/roles/list').name,
         require('./modules/private/servers').name,
         require('./modules/private/servers/configFiles').name,
         require('./modules/private/servers/deliveryServices').name,
@@ -268,6 +272,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,
@@ -299,6 +304,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/serverConfigFiles').name,
         require('./common/modules/table/serverDeliveryServices').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 000000000..da8df4ffd
--- /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 bcd9b3bbc..70b77bc6f 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 3942a7647..9da91f6f5 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 be46a18c4..50cc57db9 100644
--- a/traffic_portal/app/src/common/modules/navigation/navigation.tpl.html
+++ b/traffic_portal/app/src/common/modules/navigation/navigation.tpl.html
@@ -42,6 +42,7 @@
                     <ul class="nav child_menu" style="display: none">
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.asns')}"><a href="/#!/asns">ASNs</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.cacheGroups')}"><a href="/#!/cache-groups">Cache Groups</a></li>
+                        <!--<li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.capabilities')}"><a href="/#!/capabilities">Capabilities</a></li>-->
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.cdns')}"><a href="/#!/cdns">CDNs</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.divisions')}"><a href="/#!/divisions">Divisions</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.jobs')}"><a href="/#!/jobs">Jobs</a></li>
@@ -49,6 +50,7 @@
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.parameters')}"><a href="/#!/parameters">Parameters</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.profiles')}"><a href="/#!/profiles">Profiles</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.regions')}"><a href="/#!/regions">Regions</a></li>
+                        <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.roles')}"><a href="/#!/roles">Roles</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.servers')}"><a href="/#!/servers">Servers</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.statuses')}"><a href="/#!/statuses">Statuses</a></li>
                         <li class="side-menu-category-item" ng-class="{'current-page': isState('trafficPortal.private.tenants')}"><a href="/#!/tenants">Tenants</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 000000000..0184f41c2
--- /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 000000000..4a1f252a6
--- /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 000000000..bf43e04a3
--- /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 000000000..22d3cb157
--- /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 000000000..b50b89f4d
--- /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 000000000..a3193a54a
--- /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/capabilities/capabilities.tpl.html b/traffic_portal/app/src/modules/private/capabilities/capabilities.tpl.html
new file mode 100644
index 000000000..4ad28d4a0
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/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/capabilities/index.js b/traffic_portal/app/src/modules/private/capabilities/index.js
new file mode 100644
index 000000000..35e452d65
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/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.capabilities', [])
+	.config(function($stateProvider, $urlRouterProvider) {
+		$stateProvider
+			.state('trafficPortal.private.capabilities', {
+				url: 'capabilities',
+				abstract: true,
+				views: {
+					privateContent: {
+						templateUrl: 'modules/private/capabilities/capabilities.tpl.html'
+					}
+				}
+			})
+		;
+		$urlRouterProvider.otherwise('/');
+	});
diff --git a/traffic_portal/app/src/modules/private/capabilities/list/index.js b/traffic_portal/app/src/modules/private/capabilities/list/index.js
new file mode 100644
index 000000000..08b6e42d3
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/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.capabilities.list', [])
+	.config(function($stateProvider, $urlRouterProvider) {
+		$stateProvider
+			.state('trafficPortal.private.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/roles/index.js b/traffic_portal/app/src/modules/private/roles/index.js
new file mode 100644
index 000000000..57c2407ad
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/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.roles', [])
+	.config(function($stateProvider, $urlRouterProvider) {
+		$stateProvider
+			.state('trafficPortal.private.roles', {
+				url: 'roles',
+				abstract: true,
+				views: {
+					privateContent: {
+						templateUrl: 'modules/private/roles/roles.tpl.html'
+					}
+				}
+			})
+		;
+		$urlRouterProvider.otherwise('/');
+	});
diff --git a/traffic_portal/app/src/modules/private/roles/list/index.js b/traffic_portal/app/src/modules/private/roles/list/index.js
new file mode 100644
index 000000000..f991001e4
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/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.roles.list', [])
+	.config(function($stateProvider, $urlRouterProvider) {
+		$stateProvider
+			.state('trafficPortal.private.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/roles/roles.tpl.html b/traffic_portal/app/src/modules/private/roles/roles.tpl.html
new file mode 100644
index 000000000..7f9d903ce
--- /dev/null
+++ b/traffic_portal/app/src/modules/private/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:
users@infra.apache.org


With regards,
Apache Git Services