mirror of https://github.com/vector-im/riot-web
Merge pull request #3437 from matrix-org/travis/fix-deactivate
Wrap deactivation check with sanity conditionspull/21833/head
commit
e18b38c409
|
@ -641,10 +641,15 @@ module.exports = createReactClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
_calculateOpsPermissions: async function(member) {
|
_calculateOpsPermissions: async function(member) {
|
||||||
|
let canDeactivate = false;
|
||||||
|
if (this.context.matrixClient) {
|
||||||
|
canDeactivate = await this.context.matrixClient.isSynapseAdministrator();
|
||||||
|
}
|
||||||
|
|
||||||
const defaultPerms = {
|
const defaultPerms = {
|
||||||
can: {
|
can: {
|
||||||
// Calculate permissions for Synapse before doing the PL checks
|
// Calculate permissions for Synapse before doing the PL checks
|
||||||
synapseDeactivate: await this.context.matrixClient.isSynapseAdministrator(),
|
synapseDeactivate: canDeactivate,
|
||||||
},
|
},
|
||||||
muted: false,
|
muted: false,
|
||||||
};
|
};
|
||||||
|
@ -668,7 +673,7 @@ module.exports = createReactClass({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
_calculateCanPermissions: async function(me, them, powerLevels) {
|
_calculateCanPermissions: function(me, them, powerLevels) {
|
||||||
const isMe = me.userId === them.userId;
|
const isMe = me.userId === them.userId;
|
||||||
const can = {
|
const can = {
|
||||||
kick: false,
|
kick: false,
|
||||||
|
|
Loading…
Reference in New Issue