}
static int
-rpc_session_grant(struct rpc_session *ses, struct ubus_context *ctx,
+rpc_session_grant(struct rpc_session *ses,
const char *scope, const char *object, const char *function)
{
struct rpc_session_acl *acl;
}
static int
-rpc_session_revoke(struct rpc_session *ses, struct ubus_context *ctx,
+rpc_session_revoke(struct rpc_session *ses,
const char *scope, const char *object, const char *function)
{
struct rpc_session_acl *acl, *next;
const char *scope = "ubus";
int rem1, rem2;
- int (*cb)(struct rpc_session *ses, struct ubus_context *ctx,
- const char *scope, const char *object, const char *function);
+ int (*cb)(struct rpc_session *ses,
+ const char *scope, const char *object, const char *function);
blobmsg_parse(acl_policy, __RPC_SA_MAX, tb, blob_data(msg), blob_len(msg));
cb = rpc_session_revoke;
if (!tb[RPC_SA_OBJECTS])
- return cb(ses, ctx, scope, NULL, NULL);
+ return cb(ses, scope, NULL, NULL);
blobmsg_for_each_attr(attr, tb[RPC_SA_OBJECTS], rem1) {
if (blob_id(attr) != BLOBMSG_TYPE_ARRAY)
}
if (object && function)
- cb(ses, ctx, scope, object, function);
+ cb(ses, scope, object, function);
}
return 0;
if (blob_id(acl_func) != BLOBMSG_TYPE_STRING)
continue;
- rpc_session_grant(ses, NULL, blobmsg_name(acl_scope),
- blobmsg_name(acl_obj),
- blobmsg_data(acl_func));
+ rpc_session_grant(ses, blobmsg_name(acl_scope),
+ blobmsg_name(acl_obj),
+ blobmsg_data(acl_func));
}
}
}
if (blob_id(acl_obj) != BLOBMSG_TYPE_STRING)
continue;
- rpc_session_grant(ses, NULL, blobmsg_name(acl_scope),
- blobmsg_data(acl_obj),
- blobmsg_name(acl_perm));
+ rpc_session_grant(ses, blobmsg_name(acl_scope),
+ blobmsg_data(acl_obj),
+ blobmsg_name(acl_perm));
}
}
}
* access groups without having to test access of each single
* <scope>/<object>/<function> tuple defined in a group.
*/
- rpc_session_grant(ses, NULL, "access-group",
- blobmsg_name(acl_group),
- blobmsg_name(acl_perm));
+ rpc_session_grant(ses, "access-group",
+ blobmsg_name(acl_group),
+ blobmsg_name(acl_perm));
}
}
}