mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +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("!") {
|
if actor_permission.actor.starts_with("!") {
|
||||||
match self.room_membership.get(&actor_permission.actor) {
|
match self.room_membership.get(&actor_permission.actor) {
|
||||||
Some(set) => {
|
Some(set) => {
|
||||||
if !set.contains(mxid) {
|
return set.contains(mxid);
|
||||||
// User not in set.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
// No cached data stored...odd.
|
// No cached data stored...odd.
|
||||||
|
@ -56,7 +56,7 @@ describe("Config/BridgePermissions", () => {
|
|||||||
it("will return true if a user is present in a room", () => {
|
it("will return true if a user is present in a room", () => {
|
||||||
const bridgePermissions = genBridgePermissions('!foo:bar', 'my-service', 'login');
|
const bridgePermissions = genBridgePermissions('!foo:bar', 'my-service', 'login');
|
||||||
bridgePermissions.addMemberToCache('!foo:bar', '@foo:bar');
|
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", () => {
|
it("will fall through and return true for multiple permission sets", () => {
|
||||||
const bridgePermissions = new BridgePermissions([
|
const bridgePermissions = new BridgePermissions([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user