Closed webpigeon closed 2 years ago
@webpigeon Would it be possible to include an example ACL in your description? Also, would you be able to add a few additional tests to validate the new behavior?
Sure - I'll do that this weekend :)
I would still appreciate an example for this.
Sorry - got sidetracked, I've added two tests and implementation of the acl attribute for testing purposes. The existing tests should be evidence that the old behaviour is kept if there is no change.
@webpigeon Thank you for your contribution!
While fixing the documentation, I noticed that rooms are using str(room) for acl matches.
__str__
is meant to be a human-readable object representation which could be something other than the room ID - although as no one spotted this I guess that in most cases it is.This commit makes it so that rooms have an aclattr, just like people do. This can then be used to store a suitable version of the room for ACL matches.
I've tried to maintain backwards compatibility in two ways:
I've checked using tox, and it passed the tests :).
in terms of bot usage differences, there shouldn't be any vs the original room-string based approach.