anchor.diff:  
   -spec(get_by_user_id(Id :: integer()) -> {ok, [Rec :: #permission{}]} | {error, string()}).
   get_by_user_id(Id) ->
  -  gen_server:call(?SERVER, {get, Id}).
  +  gen_server:call(?SERVER, {get_by_user_id, Id}).
  +
  +-spec(get_by_device_id(Id :: integer()) -> {ok, [Rec :: #permission{}]} | {error, string()}).
  +get_by_device_id(Id) ->
  +  gen_server:call(?SERVER, {get_by_device_id, Id}).
   
   -spec(create(Permission :: #permission{}) -> {ok, #permission{}} | {error, string()}).
   create(Permission) ->
  
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: 
  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) ->
  