From: Zdeněk Šustr Date: Wed, 16 May 2012 12:43:32 +0000 (+0000) Subject: Convenience function to check current user's (ctx) authorization for actions. X-Git-Tag: merge_32_head_src~13 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=a9f8cf6c564a5aeb39c60cff4a91239141a2e3e3;p=jra1mw.git Convenience function to check current user's (ctx) authorization for actions. --- diff --git a/org.glite.lb.server/src/authz_policy.c b/org.glite.lb.server/src/authz_policy.c index 0c213e0..2d03e88 100644 --- a/org.glite.lb.server/src/authz_policy.c +++ b/org.glite.lb.server/src/authz_policy.c @@ -123,6 +123,19 @@ check_authz_policy(edg_wll_authz_policy policy, return 0; } +int +check_authz_policy_ctx(edg_wll_Context ctx, + authz_action action) +{ + struct _edg_wll_GssPrincipal_data princ; + memset(&princ, 0, sizeof princ); + + princ.name = ctx->peerName; + princ.fqans = ctx->fqans; + + return check_authz_policy(&ctx->authz_policy, &princ, action); +} + authz_action find_authz_action(const char *name) { diff --git a/org.glite.lb.server/src/authz_policy.h b/org.glite.lb.server/src/authz_policy.h index b6f73b9..a37d87a 100644 --- a/org.glite.lb.server/src/authz_policy.h +++ b/org.glite.lb.server/src/authz_policy.h @@ -59,6 +59,9 @@ parse_server_policy(edg_wll_Context ctx, const char *filename, edg_wll_authz_pol int check_authz_policy(edg_wll_authz_policy, edg_wll_GssPrincipal, authz_action); +int +check_authz_policy_ctx(edg_wll_Context ctx, authz_action); + authz_action find_authz_action(const char *name);