|
|
@@ -1,74 +1,135 @@
|
|
|
-<div class="editor-row">
|
|
|
- <h5 class="section-heading">Add New Permission</h5>
|
|
|
- <form name="addPermission" class="gf-form-group">
|
|
|
- <div class="gf-form-inline">
|
|
|
- <div class="gf-form">
|
|
|
- <span class="gf-form-label">Type</span>
|
|
|
- <select class="gf-form-input gf-size-auto" ng-model="ctrl.type" ng-options="r for r in ['User Group', 'User']"></select>
|
|
|
- </div>
|
|
|
- <div class="gf-form" ng-show="ctrl.type === 'User'">
|
|
|
- <span class="gf-form-label">User</span>
|
|
|
- <user-picker user-id="ctrl.userId"></user-picker>
|
|
|
+<div class="modal-body modal-body--with-overflow">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h2 class="modal-header-title">
|
|
|
+ <i class="fa fa-lock"></i>
|
|
|
+ <span class="p-l-1">Permissions</span>
|
|
|
+ </h2>
|
|
|
+
|
|
|
+ <a class="modal-header-close" ng-click="ctrl.dismiss();">
|
|
|
+ <i class="fa fa-remove"></i>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <form ng-submit="ctrl.save()" class="modal-content" novalidate>
|
|
|
+ <!-- <h5 class="section-heading">Add New Permission</h5> -->
|
|
|
+ <!-- <form name="addPermission" class="gf-form-group"> -->
|
|
|
+ <!-- <div class="gf-form-inline"> -->
|
|
|
+ <!-- <div class="gf-form"> -->
|
|
|
+ <!-- <span class="gf-form-label">Type</span> -->
|
|
|
+ <!-- <select class="gf-form-input gf-size-auto" ng-model="ctrl.type" ng-options="r for r in ['User Group', 'User']"></select> -->
|
|
|
+ <!-- </div> -->
|
|
|
+ <!-- <div class="gf-form" ng-show="ctrl.type === 'User'"> -->
|
|
|
+ <!-- <span class="gf-form-label">User</span> -->
|
|
|
+ <!-- <user-picker user-id="ctrl.userId"></user-picker> -->
|
|
|
+ <!-- </div> -->
|
|
|
+ <!-- <div class="gf-form" ng-show="ctrl.type === 'User Group'"> -->
|
|
|
+ <!-- <span class="gf-form-label">User Group</span> -->
|
|
|
+ <!-- <user-group-picker user-group-id="ctrl.userGroupId"></user-group-picker> -->
|
|
|
+ <!-- </div> -->
|
|
|
+ <!-- <div class="gf-form"> -->
|
|
|
+ <!-- <span class="gf-form-label">Permission</span> -->
|
|
|
+ <!-- <select class="gf-form-input gf-size-auto" ng-model="ctrl.permission" ng-options="p.value as p.text for p in ctrl.permissionTypeOptions"></select> -->
|
|
|
+ <!-- </div> -->
|
|
|
+ <!-- <div class="gf-form"> -->
|
|
|
+ <!-- <button class="btn gf-form-btn btn-success" ng-click="ctrl.addPermission()">Add</button> -->
|
|
|
+ <!-- </div> -->
|
|
|
+ <!-- </div> -->
|
|
|
+ <!-- </form> -->
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <div class="section">
|
|
|
+ <h5 class="section-heading">Groups & Users</h5>
|
|
|
+ <div class="gf-form" ng-repeat="acl in ctrl.userAcl">
|
|
|
+ <span class="gf-form-label width-15">
|
|
|
+ <i class="fa fa-fw fa-user"></i>
|
|
|
+ {{acl.userLogin}}
|
|
|
+ </span>
|
|
|
+ <div class="gf-form-select-wrapper">
|
|
|
+ <select class="gf-form-input gf-size-auto" ng-model="acl.permissions" ng-options="p.value as p.text for p in ctrl.permissionTypeOptions" ng-change="ctrl.updatePermission(permission)"></select>
|
|
|
+ </div>
|
|
|
+ <button class="btn btn-inverse gf-form-btn" ng-click="ctrl.addQuery()" ng-hide="ctrl.current.meta.mixed">
|
|
|
+ <i class="fa fa-remove"></i>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div class="gf-form">
|
|
|
+ <button class="btn btn-inverse gf-form-btn" ng-click="ctrl.addQuery()" ng-hide="ctrl.current.meta.mixed">
|
|
|
+ <i class="fa fa-fw fa-plus"></i>
|
|
|
+ Add Permission
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="gf-form" ng-show="ctrl.type === 'User Group'">
|
|
|
- <span class="gf-form-label">User Group</span>
|
|
|
- <user-group-picker user-group-id="ctrl.userGroupId"></user-group-picker>
|
|
|
+ <div class="section pull-right">
|
|
|
+ <h5 class="section-heading">Built-in roles</h5>
|
|
|
+ <div class="gf-form" ng-repeat="roleAcl in ctrl.roles">
|
|
|
+ <span class="gf-form-label width-5">
|
|
|
+ {{roleAcl.name}}
|
|
|
+ </span>
|
|
|
+ <div class="gf-form-select-wrapper">
|
|
|
+ <select class="gf-form-input gf-size-auto" ng-model="roleAcl.permissions" ng-options="p.value as p.text for p in ctrl.roleOptions" ng-change="ctrl.updatePermission(permission)"></select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="gf-form">
|
|
|
- <span class="gf-form-label">Permission</span>
|
|
|
- <select class="gf-form-input gf-size-auto" ng-model="ctrl.permission" ng-options="p.value as p.text for p in ctrl.permissionTypeOptions"></select>
|
|
|
- </div>
|
|
|
- <div class="gf-form">
|
|
|
- <button class="btn gf-form-btn btn-success" ng-click="ctrl.addPermission()">Add</button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="permissionlist">
|
|
|
- <div class="permissionlist__section">
|
|
|
- <div class="permissionlist__section-header">
|
|
|
- <h6>Permissions</h6>
|
|
|
- </div>
|
|
|
- <table class="filter-table form-inline">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th style="width: 50px;"></th>
|
|
|
- <th>Name</th>
|
|
|
- <th style="width: 220px;">Permission</th>
|
|
|
- <th style="width: 120px"></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr ng-repeat="permission in ctrl.userPermissions" class="permissionlist__item">
|
|
|
- <td><i class="fa fa-fw fa-user"></i></td>
|
|
|
- <td>{{permission.userLogin}}</td>
|
|
|
- <td><select class="gf-form-input gf-size-auto" ng-model="permission.permissions" ng-options="p.value as p.text for p in ctrl.permissionTypeOptions" ng-change="ctrl.updatePermission(permission)"></select></td>
|
|
|
- <td class="text-right">
|
|
|
- <a ng-click="ctrl.removePermission(permission)" class="btn btn-danger btn-small">
|
|
|
- <i class="fa fa-remove"></i>
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr ng-repeat="permission in ctrl.userGroupPermissions" class="permissionlist__item">
|
|
|
- <td><i class="fa fa-fw fa-users"></i></td>
|
|
|
- <td>{{permission.userGroup}}</td>
|
|
|
- <td><select class="gf-form-input gf-size-auto" ng-model="permission.permissions" ng-options="p.value as p.text for p in ctrl.permissionTypeOptions" ng-change="ctrl.updatePermission(permission)"></select></td>
|
|
|
- <td class="text-right">
|
|
|
- <a ng-click="ctrl.removePermission(permission)" class="btn btn-danger btn-small">
|
|
|
- <i class="fa fa-remove"></i>
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr ng-repeat="role in ctrl.roles" class="permissionlist__item">
|
|
|
- <td></td>
|
|
|
- <td>{{role.name}}</td>
|
|
|
- <td><select class="gf-form-input gf-size-auto" ng-model="role.permissions" ng-options="p.value as p.text for p in ctrl.roleOptions" ng-change="ctrl.updatePermission(role)"></select></td>
|
|
|
- <td class="text-right">
|
|
|
+ <div class="clearfix"></div>
|
|
|
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
+ <div class="gf-form-button-row text-center">
|
|
|
+ <button type="submit" class="btn btn-danger" ng-disabled="!ctrl.canUpdate">Update Permissions</button>
|
|
|
+ <a class="btn-text" ng-click="ctrl.dismiss();">Close</a>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+
|
|
|
+ </form>
|
|
|
</div>
|
|
|
+
|
|
|
+<!-- <br> -->
|
|
|
+<!-- <br> -->
|
|
|
+<!-- <br> -->
|
|
|
+<!-- -->
|
|
|
+<!-- <div class="permissionlist"> -->
|
|
|
+<!-- <div class="permissionlist__section"> -->
|
|
|
+<!-- <div class="permissionlist__section-header"> -->
|
|
|
+<!-- <h6>Permissions</h6> -->
|
|
|
+<!-- </div> -->
|
|
|
+<!-- <table class="filter-table form-inline"> -->
|
|
|
+<!-- <thead> -->
|
|
|
+<!-- <tr> -->
|
|
|
+<!-- <th style="width: 50px;"></th> -->
|
|
|
+<!-- <th>Name</th> -->
|
|
|
+<!-- <th style="width: 220px;">Permission</th> -->
|
|
|
+<!-- <th style="width: 120px"></th> -->
|
|
|
+<!-- </tr> -->
|
|
|
+<!-- </thead> -->
|
|
|
+<!-- <tbody> -->
|
|
|
+<!-- <tr ng-repeat="permission in ctrl.userPermissions" class="permissionlist__item"> -->
|
|
|
+<!-- <td><i class="fa fa-fw fa-user"></i></td> -->
|
|
|
+<!-- <td>{{permission.userLogin}}</td> -->
|
|
|
+<!-- <td><select class="gf-form-input gf-size-auto" ng-model="permission.permissions" ng-options="p.value as p.text for p in ctrl.permissionTypeOptions" ng-change="ctrl.updatePermission(permission)"></select></td> -->
|
|
|
+<!-- <td class="text-right"> -->
|
|
|
+<!-- <a ng-click="ctrl.removePermission(permission)" class="btn btn-danger btn-small"> -->
|
|
|
+<!-- <i class="fa fa-remove"></i> -->
|
|
|
+<!-- </a> -->
|
|
|
+<!-- </td> -->
|
|
|
+<!-- </tr> -->
|
|
|
+<!-- <tr ng-repeat="permission in ctrl.userGroupPermissions" class="permissionlist__item"> -->
|
|
|
+<!-- <td><i class="fa fa-fw fa-users"></i></td> -->
|
|
|
+<!-- <td>{{permission.userGroup}}</td> -->
|
|
|
+<!-- <td><select class="gf-form-input gf-size-auto" ng-model="permission.permissions" ng-options="p.value as p.text for p in ctrl.permissionTypeOptions" ng-change="ctrl.updatePermission(permission)"></select></td> -->
|
|
|
+<!-- <td class="text-right"> -->
|
|
|
+<!-- <a ng-click="ctrl.removePermission(permission)" class="btn btn-danger btn-small"> -->
|
|
|
+<!-- <i class="fa fa-remove"></i> -->
|
|
|
+<!-- </a> -->
|
|
|
+<!-- </td> -->
|
|
|
+<!-- </tr> -->
|
|
|
+<!-- <tr ng-repeat="role in ctrl.roles" class="permissionlist__item"> -->
|
|
|
+<!-- <td></td> -->
|
|
|
+<!-- <td>{{role.name}}</td> -->
|
|
|
+<!-- <td><select class="gf-form-input gf-size-auto" ng-model="role.permissions" ng-options="p.value as p.text for p in ctrl.roleOptions" ng-change="ctrl.updatePermission(role)"></select></td> -->
|
|
|
+<!-- <td class="text-right"> -->
|
|
|
+ <!-- -->
|
|
|
+ <!-- </td> -->
|
|
|
+ <!-- </tr> -->
|
|
|
+ <!-- </tbody> -->
|
|
|
+ <!-- </table> -->
|
|
|
+ <!-- </div> -->
|
|
|
+<!-- </div> -->
|
|
|
+<!-- </div> -->
|