projects
/
project
/
rpcd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
743901c
)
session: expose rpc_session_access() function for testing session ACLs in other rpcd...
author
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 12 Aug 2013 11:51:51 +0000
(13:51 +0200)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 12 Aug 2013 11:51:51 +0000
(13:51 +0200)
session.c
patch
|
blob
|
history
session.h
patch
|
blob
|
history
diff --git
a/session.c
b/session.c
index
35324bf
..
b43e763
100644
(file)
--- a/
session.c
+++ b/
session.c
@@
-709,3
+709,14
@@
int rpc_session_api_init(struct ubus_context *ctx)
return ubus_add_object(ctx, &obj);
}
return ubus_add_object(ctx, &obj);
}
+
+bool rpc_session_access(const char *sid, const char *scope,
+ const char *object, const char *function)
+{
+ struct rpc_session *ses = rpc_session_get(sid);
+
+ if (!ses)
+ return false;
+
+ return rpc_session_acl_allowed(ses, scope, object, function);
+}
diff --git
a/session.h
b/session.h
index
0bcae7b
..
3f50e77
100644
(file)
--- a/
session.h
+++ b/
session.h
@@
-56,4
+56,7
@@
struct rpc_session_acl {
int rpc_session_api_init(struct ubus_context *ctx);
int rpc_session_api_init(struct ubus_context *ctx);
+bool rpc_session_access(const char *sid, const char *scope,
+ const char *object, const char *function);
+
#endif
#endif