Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Clearning the token cache after element creation.

  • Loading branch information...
commit 32969a21f79120208d5cd381879b8c045718dbc1 1 parent 53b88b3
@Licenser Licenser authored
View
2  apps/wiggle/src/wiggle.app.src
@@ -1,7 +1,7 @@
{application, wiggle,
[
{description, ""},
- {vsn, "0.6.1p5"},
+ {vsn, "0.6.1p6"},
{registered, []},
{applications, [
kernel,
View
4 apps/wiggle/src/wiggle_handler.erl
@@ -14,11 +14,15 @@
service_available/0,
encode/2,
get_persmissions/1,
+ clear_permissions/1,
timeout_cache_with_invalid/6,
timeout_cache/5,
list/9
]).
+clear_permissions(#state{token = Token}) ->
+ e2qc:evict(permissions, Token).
+
initial_state(Req) ->
{Method, Req0} = cowboy_req:method(Req),
{Version, Req1} = cowboy_req:binding(version, Req0),
View
8 apps/wiggle/src/wiggle_rest_handler.erl
@@ -216,7 +216,9 @@ write(Req, State = #state{module = M, body = undefined}) ->
lager:info("This is a raw request"),
case cowboy_req:method(Req) of
{<<"POST">>, Req1} ->
- M:create(Req1, State, undefined);
+ R = M:create(Req1, State, undefined),
+ wiggle_handler:clear_permissions(State),
+ R;
{<<"PUT">>, Req1} ->
M:write(Req1, State, undefined)
end;
@@ -228,7 +230,9 @@ write(Req, State = #state{module = M, body = undefined}) ->
write(Req, State = #state{module = M, body = Data}) ->
case cowboy_req:method(Req) of
{<<"POST">>, Req1} ->
- M:create(Req1, State, Data);
+ R = M:create(Req1, State, Data),
+ wiggle_handler:clear_permissions(State),
+ R;
{<<"PUT">>, Req1} ->
M:write(Req1, State, Data)
end.
View
23 hooks/pre-commit
@@ -7,26 +7,3 @@
#
# To enable this hook, rename this file to "pre-commit".
-if git rev-parse --verify HEAD >/dev/null 2>&1
-then
- against=HEAD
-else
- # Initial commit: diff against an empty tree object
- against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
-fi
-
-make quick-xref
-RETVAL=$?
-if [ $RETVAL -ne 0 ]
-then
- echo "XRef failed."
- exit 1
-fi
-
-make quick-test
-RETVAL=$?
-if [ $RETVAL -ne 0 ]
-then
- echo "Test failed."
- exit 1
-fi
View
2  rel/pkg/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.6.1p5
+VERSION=0.6.1p6
COMPONENT_INTERNAL=wiggle
COMPONENT=fifo-wiggle
View
2  rel/reltool.config
@@ -1,7 +1,7 @@
%% -*- erlang -*-
{sys, [
{lib_dirs, ["../deps", "../apps"]},
- {rel, "wiggle", "0.6.1p5",
+ {rel, "wiggle", "0.6.1p6",
[
kernel,
stdlib,
Please sign in to comment.
Something went wrong with that request. Please try again.