| summaryrefslogtreecommitdiff |
diff options
| author | nsensfel <SpamShield0@noot-noot.org> | 2019-01-18 18:32:59 +0100 |
|---|---|---|
| committer | nsensfel <SpamShield0@noot-noot.org> | 2019-01-18 18:32:59 +0100 |
| commit | 93e613bb5bbb1eb58135e68bb184c7cf6d230ad8 (patch) | |
| tree | 5442d50d8145fae6dc074b776979e128b2757c7a /src/ataxia_server.erl | |
| parent | 44c976dd490accd3eed1ff49b5df476bcdb6c9b8 (diff) | |
Fixes position of ID param for add_at & reserve_at
Diffstat (limited to 'src/ataxia_server.erl')
| -rw-r--r-- | src/ataxia_server.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ataxia_server.erl b/src/ataxia_server.erl index 4453e63..717957b 100644 --- a/src/ataxia_server.erl +++ b/src/ataxia_server.erl @@ -202,14 +202,14 @@ fetch_if_internals (DB, User, ID, Cond) -> -spec add_at ( atom(), - ataxia_id:type(), ataxia_security:permission(), ataxia_security:permission(), ataxia_lock:type(), - any() + any(), + ataxia_id:type() ) -> ({'aborted', any()} | 'ok'). -add_at (DB, ID, ReadPerm, WritePerm, Lock, Value) -> +add_at (DB, ReadPerm, WritePerm, Lock, Value, ID) -> Item = ataxia_entry:new(ID, ReadPerm, WritePerm, Lock, Value), case mnesia:transaction(fun add_new_item/2, [DB, Item]) of {atomic, ok} -> ok; @@ -227,7 +227,7 @@ add_at (DB, ID, ReadPerm, WritePerm, Lock, Value) -> -> ({'aborted', any()} | {'ok', ataxia_id:type()}). add (DB, ReadPerm, WritePerm, Lock, Value) -> ID = ataxia_id_manager:allocate(DB), - case add_at(DB, ID, ReadPerm, WritePerm, Lock, Value) of + case add_at(DB, ReadPerm, WritePerm, Lock, Value, ID) of ok -> {ok, ID}; {aborted, Val} -> {aborted, Val} end. @@ -246,11 +246,11 @@ reserve_at (DB, ReadPerm, WritePerm, Lock, ID) -> add_at ( DB, - ID, ataxia_security:add_access(ataxia_security:janitor(), ReadPerm), ataxia_security:add_access(ataxia_security:janitor(), WritePerm), Lock, % TODO: allow the janitor there. - reserved + reserved, + ID ). -spec reserve |


