Filter relationships by permission

This commit is contained in:
Maikel Linke
2015-06-12 17:02:40 +10:00
parent 61effc03c1
commit d717c38f6d
6 changed files with 31 additions and 7 deletions

View File

@@ -10,6 +10,18 @@ angular.module("ofn.admin").controller "AdminEnterpriseRelationshipsCtrl", ($sco
if confirm("Are you sure?")
$scope.EnterpriseRelationships.delete enterprise_relationship
$scope.toggleKeyword = (string, key) ->
string = '' unless string
words = string.split ' '
words = words.filter (s) ->
s
index = words.indexOf key
if index > -1
words.splice index, 1
else
words.push key
words.join ' '
$scope.allPermissionsChecked = ->
for i in EnterpriseRelationships.all_permissions
if !$scope.permissions[i]