|
|
@@ -1,4 +1,4 @@
|
|
|
-<div class="modal-body modal-body--with-overflow">
|
|
|
+<div class="modal-body">
|
|
|
<div class="modal-header">
|
|
|
<h2 class="modal-header-title">
|
|
|
<i class="fa fa-lock"></i>
|
|
|
@@ -10,111 +10,118 @@
|
|
|
</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> -->
|
|
|
-
|
|
|
- <table class="filter-table">
|
|
|
+ <div class="modal-content">
|
|
|
+ <table class="filter-table gf-form-group">
|
|
|
<tr ng-repeat="acl in ctrl.aclItems">
|
|
|
<td style="width: 100%;">
|
|
|
<i class="{{acl.icon}}"></i>
|
|
|
<span ng-bind-html="acl.nameHtml"></span>
|
|
|
</td>
|
|
|
- <td>can...</td>
|
|
|
- <td class="dropdown">
|
|
|
- <a class="pointer" style="white-space: nowrap">
|
|
|
- {{acl.permissionName}}
|
|
|
- <i class="fa fa-caret-down"></i>
|
|
|
- </a>
|
|
|
+ <td class="query-keyword">Can</td>
|
|
|
+ <td>
|
|
|
+ <div class="gf-form-select-wrapper">
|
|
|
+ <select class="gf-form-input gf-size-auto" ng-model="acl.permission" ng-options="p.value as p.text for p in ctrl.permissionOptions" ng-change="ctrl.permissionChanged(acl)"></select>
|
|
|
+ </div>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <a class="btn btn-inverse btn-small" ng-show="revision.version !== ctrl.dashboard.version" ng-click="ctrl.restore(revision.version)">
|
|
|
+ <a class="btn btn-inverse btn-small" ng-click="ctrl.removeItem($index)">
|
|
|
<i class="fa fa-remove"></i>
|
|
|
</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
+ <tr ng-show="ctrl.aclItems.length === 0">
|
|
|
+ <td colspan="4">
|
|
|
+ <em>No permission, will only accessable by admins.</em>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
</table>
|
|
|
|
|
|
+ <form name="addPermission" class="gf-form-group">
|
|
|
+ <h6 class="muted">Add Permission For</h6>
|
|
|
+ <div class="gf-form-inline">
|
|
|
+ <div class="gf-form">
|
|
|
+ <div class="gf-form-select-wrapper">
|
|
|
+ <select class="gf-form-input gf-size-auto" ng-model="ctrl.newType" ng-options="r for r in ['User Group', 'User']"></select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="gf-form" ng-show="ctrl.newType === 'User'">
|
|
|
+ <span class="gf-form-label">User</span>
|
|
|
+ <user-picker user-picked="ctrl.userPicked($user)"></user-picker>
|
|
|
+ </div>
|
|
|
+ <div class="gf-form" ng-show="ctrl.newType === 'User Group'">
|
|
|
+ <span class="gf-form-label">User Group</span>
|
|
|
+ <user-group-picker user-group-id="ctrl.newAcl.userGroupId"></user-group-picker>
|
|
|
+ </div>
|
|
|
+ <div class="gf-form">
|
|
|
+ <span class="gf-form-label query-keyword">Can</span>
|
|
|
+ <div class="gf-form-select-wrapper">
|
|
|
+ <select class="gf-form-input gf-size-auto" ng-model="ctrl.newAcl.permission" ng-options="p.value as p.text for p in ctrl.permissionOptions"></select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="gf-form">
|
|
|
+ <button class="btn gf-form-btn btn-secondary" ng-click="ctrl.addPermission()">Add</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
|
|
|
<div class="gf-form-button-row text-center">
|
|
|
- <button type="submit" class="btn btn-danger" ng-disabled="!ctrl.canUpdate">Update Permissions</button>
|
|
|
+ <button type="button" class="btn btn-danger" ng-disabled="!ctrl.canUpdate" ng-click="ctrl.update()">
|
|
|
+ Update Permissions
|
|
|
+ </button>
|
|
|
<a class="btn-text" ng-click="ctrl.dismiss();">Close</a>
|
|
|
</div>
|
|
|
|
|
|
- </form>
|
|
|
-</div>
|
|
|
+ </div>
|
|
|
+ </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> -->
|
|
|
+ <!-- <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 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> -->
|