meds.users¶
Users object to manage bot users permissions.
-
class
User
(origin, permissions=['USER'])[source]¶ Bases:
meds.object.Object
User class to represent a bot user.
construct a user with an origin and a list of permissions
>>> from meds.users import User >>> user = User("root@shell", ["REBOOT", "START"]) >>> print(user) { "permissions": [ "REBOOT", "START" ], "prefix": "user", "user": "root@shell" } >>> path = user.sync()
-
class
Users
[source]¶ Bases:
meds.storage.Storage
Users class to query whether a user has a permission.
the core module contains an preconstructed users object:
>>> from meds.core import users >>> users.allowed("root@shell", "REBOOT") True