mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 13:17:08 +00:00
Argh permissions bug
This commit is contained in:
parent
72eb24bf57
commit
7e2ffdd2df
@ -61,10 +61,7 @@ impl BridgePermissions {
|
||||
if actor_permission.actor.starts_with("!") {
|
||||
match self.room_membership.get(&actor_permission.actor) {
|
||||
Some(set) => {
|
||||
if !set.contains(mxid) {
|
||||
// User not in set.
|
||||
return false;
|
||||
}
|
||||
return set.contains(mxid);
|
||||
}
|
||||
None => {
|
||||
// No cached data stored...odd.
|
||||
|
@ -56,7 +56,7 @@ describe("Config/BridgePermissions", () => {
|
||||
it("will return true if a user is present in a room", () => {
|
||||
const bridgePermissions = genBridgePermissions('!foo:bar', 'my-service', 'login');
|
||||
bridgePermissions.addMemberToCache('!foo:bar', '@foo:bar');
|
||||
expect(bridgePermissions.checkAction("@foo:bar", "my-service", "login")).to.be.false;
|
||||
expect(bridgePermissions.checkAction("@foo:bar", "my-service", "login")).to.be.true;
|
||||
});
|
||||
it("will fall through and return true for multiple permission sets", () => {
|
||||
const bridgePermissions = new BridgePermissions([
|
||||
|
Loading…
x
Reference in New Issue
Block a user