mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Owner's permissions can't be deleted
This commit is contained in:
committed by
Rob Harrington
parent
ba98c7e2c5
commit
27de66b055
@@ -35,6 +35,8 @@ angular.module("admin.enterprises")
|
||||
|
||||
$scope.removeManager = (manager) ->
|
||||
if manager.id?
|
||||
if manager.id == $scope.Enterprise.owner.id
|
||||
return
|
||||
for i, user of $scope.Enterprise.users when user.id == manager.id
|
||||
$scope.Enterprise.users.splice i, 1
|
||||
if $scope.enterprise_form?
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
= hidden_field_tag "enterprise[user_ids][]", nil, multiple: true, 'ng-value' => 'manager.id'
|
||||
{{ manager.email }}
|
||||
%td.actions
|
||||
%a{ 'ng-click' => 'removeManager(manager)', :class => "icon-trash no-text" }
|
||||
%a{ ng: {click: 'removeManager(manager)', class: "{disabled: manager.id == Enterprise.owner.id}"}, :class => "icon-trash no-text" }
|
||||
- else
|
||||
- @enterprise.users.each do |manager|
|
||||
= manager.email
|
||||
|
||||
Reference in New Issue
Block a user