Convenience function to check current user's (ctx) authorization for actions.
authorZdeněk Šustr <sustr4@cesnet.cz>
Wed, 16 May 2012 12:43:32 +0000 (12:43 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Wed, 16 May 2012 12:43:32 +0000 (12:43 +0000)
org.glite.lb.server/src/authz_policy.c
org.glite.lb.server/src/authz_policy.h

index 0c213e0..2d03e88 100644 (file)
@@ -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)
 {
index b6f73b9..a37d87a 100644 (file)
@@ -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);