anchor.diff:  %%%===================================================================
   %%% API
   %%%===================================================================
  +-spec(get() -> {ok, [Rec :: #permission{}]} | {error, string()}).
  +get() ->
  +  gen_server:call(?SERVER, {get}).
  +
   -spec(get_by_user_id(Id :: integer()) -> {ok, [Rec :: #permission{}]} | {error, string()}).
   get_by_user_id(Id) ->
     gen_server:call(?SERVER, {get, Id}).
  
positive.code: -export([start_link/0]).
  
  -export([
    get_by_user_id/1,
    create/1,
    delete/1
  
negative.code: do_delete_permission(State = #state{cache = Cache}, PermissionModel) ->
    case em_storage:delete_permission(PermissionModel) of
      {ok, Permission} ->
        Match = ets:fun2ms(fun(#permission{userId = UserId, deviceId = DeviceId}) when (UserId =:= Permission#permission.userId) and (DeviceId =:= Permission#permission.deviceId) -> true end),
        case ets:select_delete(Cache, Match) of
          0 ->
            {reply, {error, <<"Error sync in permissions cache">>}, State};
          _ ->
            {reply, {ok, Permission}, State}
        end;
      Reason ->
        {reply, Reason, State}
  