How to run default script when user request the api


(David shi) #1

Hi guys:

I have data like: {"emolument":20000, "partment":"Financial", "ACL":
{"jack":"rw","david":"r"} }

Now when user request api with "DELETE" or "PUT" (with useranme like.
jack, david....), I will check permission with username in ACL.

But how to do it would be more convenient to perform this check by default,
like. if ACL.username in [rw, w] to do next else stop request and raise
exception

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6998a8c5-739e-4ed9-918a-528378cf2348%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Hendrik) #2

Maybe this helps: https://github.com/salyh/elasticsearch-security-plugin

Am Sonntag, 26. Januar 2014 05:39:59 UTC+1 schrieb David shi:

Hi guys:

I have data like: {"emolument":20000, "partment":"Financial", "ACL":
{"jack":"rw","david":"r"} }

Now when user request api with "DELETE" or "PUT" (with useranme like.
jack, david....), I will check permission with username in ACL.

But how to do it would be more convenient to perform this check by
default, like. if ACL.username in [rw, w] to do next else stop request
and raise exception

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f4085f7c-bd13-4853-8f26-84ed33a724f5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3