       when 'tree'         then return createTree values
       else throw new Error "Unknown structure #{structure}"
 
-  getPermissionsOfRole: (role)->
+
+  getPermissionsOfRole: (role) ->
+
     allValues = @list()
     selectedRoleValues = []
     selectedRoleValues.push permission for permission in allValues when permission.role is role

            cascadeFormElements set, roles, module, permission, roles.length
    permissionOptions

  createTree =(values)->
    values.reduce (acc, {module, role, permission})->
      acc[module] ?= {}
      acc[module][role] ?= []
      acc[module][role].push permission
      return acc
    , {}

  createReducedList =(values)->
    cache = {}
    values.reduce (acc, {module, role, permission})->
      storageKey = "#{module}:#{role}"
      cached = cache[storageKey]
      if cached?

    if current and remainder.length > 0
      cascadeData[current].nextElement = cascadeFormElements set, remainder, module, permission, roleCount
    return cascadeData


  optionizePermissions = (roles, set) ->

