Any good UBUS ACL tutorials available?

I am trying to use the ubus ACL feature with ubusd but due to lack of information I am unable to create proper ubus acl.json file at /usr/share/acl.d location.
Setup-
ubusd -> root
myModule1 -> non_root_user
myModule2 -> non_root_user
With help of 'acl_policy', I framed my JSON file which enable the method calling for non-root user but the ubus notifications are still not working.

{
  "user": "alok",
  "access": {
    "module1": {
      "methods": [
        "get_dump_list"
      ]
    },
    "module2": {
      "methods": [
        "get_info"
      ]
    }
  },
  "send": [
    "module1",
    "module2"
  ],
  "subscribe": [
    "module1",
    "module2"
  ],
  "publish": [
    "module1",
    "module2"
  ]
}

Are there any tutorials out there or documentation that actually explains what's going on?

Regards
Alok

How do you access ubus? Via the local UNIX domain socket or via HTTP?

Accessing ubus via local UNIX domain socket.
Similar as https://lxr.openwrt.org/source/ubus/examples/

Hi! Maybe a bit late for answer but I looked into the ubus code. Your ACL is correct.

But the mistake I made was to create the ACL file as "normal" user. The file must be created by a root user. The uid and gid must be 0. so

stat youracl.json

must return something like:
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)

1 Like