anchor.diff:  
   do_get_permissions_by_user_id(State = #state{cache = Cache}, SearchUserId) ->
     Match = ets:fun2ms(fun(Permission = #permission{userId = UserId}) when UserId =:= SearchUserId -> Permission end),
  +  {reply, {ok, ets:select(Cache, Match)}, State}.
  +
  +do_get_permissions_by_device_id(State = #state{cache = Cache}, SearchDeviceId) ->
  +  Match = ets:fun2ms(fun(Permission = #permission{deviceId = DeviceId}) when DeviceId =:= SearchDeviceId -> Permission end),
     {reply, {ok, ets:select(Cache, Match)}, State}.
   
   do_create_permission(State = #state{cache = Cache}, PermissionModel) ->
  
positive.code:   do_get_permissions(State);
  handle_call({get, UserId, DeviceId}, _From, State) ->
    do_get_permission(State, UserId, DeviceId);
  handle_call({get, Id}, _From, State) when is_integer(Id) ->
    do_get_permissions_by_user_id(State, Id);
  handle_call({create, Permission}, _From, State) ->
    do_create_permission(State, Permission);
  handle_call({delete, Permission}, _From, State) ->
  
negative.code:   get/0,
    get/2,
    get_by_user_id/1,
    get_by_device_id/1,
    create/1,
    delete/1
  ]).
  