+ * Test read access to given config. If the passed "sid" blob attribute pointer
+ * is NULL then the precedure was not invoked through the ubus-rpc so we do not
+ * perform access control and always assume true.
+ */
+static bool
+rpc_uci_read_access(struct blob_attr *sid, struct blob_attr *config)
+{
+ if (!sid)
+ return true;
+
+ return rpc_session_access(blobmsg_data(sid), "uci",
+ blobmsg_data(config), "read");
+}
+
+/*
+ * Test write access to given config. If the passed "sid" blob attribute pointer
+ * is NULL then the precedure was not invoked through the ubus-rpc so we do not
+ * perform access control and always assume true.
+ */
+static bool
+rpc_uci_write_access(struct blob_attr *sid, struct blob_attr *config)
+{
+ if (!sid)
+ return true;
+
+ return rpc_session_access(blobmsg_data(sid), "uci",
+ blobmsg_data(config), "write");
+}
+
+/*