1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

restricted manager view on users

This commit is contained in:
Sylvain 2020-04-28 13:20:12 +02:00
parent 2897c4c20d
commit e4f5a0f833
4 changed files with 14 additions and 8 deletions

View File

@ -7,7 +7,9 @@
</div>
</div>
<div class="col-md-12">
<button type="button" class="btn btn-warning m-t m-b" ui-sref="app.admin.admins_new" translate>{{ 'app.admin.members.add_a_new_administrator' }}</button>
<button type="button" class="btn btn-warning m-t m-b" ui-sref="app.admin.admins_new" ng-show="isAuthorized('admin')" translate>
{{ 'app.admin.members.add_a_new_administrator' }}
</button>
<table class="table">
<thead>
@ -29,7 +31,7 @@
<td>{{ admin.email }}</td>
<td>{{ admin.profile_attributes.phone }}</td>
<td>
<button class="btn btn-danger" ng-if="admin.id != currentUser.id" ng-click="destroyAdmin(admins, admin)">
<button class="btn btn-danger" ng-if="isAuthorized('admin') && admin.id != currentUser.id" ng-click="destroyAdmin(admins, admin)">
<i class="fa fa-trash-o"></i>
</button>
</td>

View File

@ -7,7 +7,9 @@
</div>
</div>
<div class="col-md-12">
<button type="button" class="btn btn-warning m-t m-b" ui-sref="app.admin.managers_new" translate>{{ 'app.admin.members.add_a_new_manager' }}</button>
<button type="button" class="btn btn-warning m-t m-b" ui-sref="app.admin.managers_new" ng-show="isAuthorized('admin')" translate>
{{ 'app.admin.members.add_a_new_manager' }}
</button>
<table class="table">
<thead>
@ -32,7 +34,7 @@
<button class="btn btn-default edit-member" ui-sref="app.admin.members_edit({id: manager.id})">
<i class="fa fa-edit"></i>
</button>
<button class="btn btn-danger" ng-if="manager.id != currentUser.id" ng-click="destroyManager(managers, manager)">
<button class="btn btn-danger" ng-if="isAuthorized('admin')" ng-click="destroyManager(managers, manager)">
<i class="fa fa-trash-o"></i>
</button>
</td>

View File

@ -18,8 +18,10 @@
</div>
</div>
<div class="col-md-12">
<button type="button" class="btn btn-warning m-t m-b" ui-sref="app.admin.members_new" translate>{{ 'app.admin.members.add_a_new_member' }}</button>
<div class="pull-right exports-buttons">
<button type="button" class="btn btn-warning m-t m-b" ui-sref="app.admin.members_new" ng-show="isAuthorized('admin')" translate>
{{ 'app.admin.members.add_a_new_member' }}
</button>
<div class="pull-right exports-buttons" ng-show="isAuthorized('admin')">
<a class="btn btn-default" ng-href="api/members/export_members.xlsx" target="export-frame" ng-click="alertExport('members')">
<i class="fa fa-file-excel-o"></i> {{ 'app.admin.members.members' | translate }}
</a>
@ -57,7 +59,7 @@
<button class="btn btn-default edit-member" ui-sref="app.admin.members_edit({id: m.id})">
<i class="fa fa-edit"></i>
</button>
<button class="btn btn-danger delete-member" ng-click="deleteMember(m.id)">
<button class="btn btn-danger delete-member" ng-click="deleteMember(m.id)" ng-show="isAuthorized('admin')">
<i class="fa fa-trash"></i>
</button>
<span class="label label-danger text-white" ng-show="m.need_completion" translate>{{ 'app.shared.user_admin.incomplete_profile' }}</span>

View File

@ -12,7 +12,7 @@
<ng-include src="'<%= asset_path "admin/members/managers.html" %>'"></ng-include>
</uib-tab>
<uib-tab classes="level-2-tab" heading="{{ 'app.admin.members.partners' | translate }}" class="admins-tab" index="3">
<uib-tab classes="level-2-tab" heading="{{ 'app.admin.members.partners' | translate }}" class="admins-tab" index="3" ng-show="isAuthorized('admin')">
<ng-include src="'<%= asset_path "admin/members/partners.html" %>'"></ng-include>
</uib-tab>