-
-
Notifications
You must be signed in to change notification settings - Fork 832
Only show editing UI for aliases/related_groups for users /w power #1529
Conversation
@@ -262,6 +262,7 @@ module.exports = React.createClass({ | |||
items={this.state.domainToAliases[localDomain] || []} | |||
newItem={this.state.newAlias} | |||
onNewItemChanged={this.onNewAliasChanged} | |||
canEdit={this.props.canSetAliases} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it ends up preventing you from adding aliases local to your homeserver. The flag given to the class is for canonical aliases, which should certainly be restricted. However arbitrary aliases are different and bypass power levels: matrix-org/synapse#2402
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced this is relevant here. canSetAliases
is always true
apparently, so this is more for clarity. canSetCanonicalAlias
is for canonical aliases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the current situation is that we hardcode canSetAliases
to true
but then also never actually read it anywhere in AliasSettings
, right? We may as well either wire the thing up if it looks trivial enough to do so (which it looks like it is) or remove it.
@@ -84,7 +84,9 @@ module.exports = React.createClass({ | |||
onNewItemChanged: PropTypes.func, | |||
onItemAdded: PropTypes.func, | |||
onItemEdited: PropTypes.func, | |||
onItemRemoved: PropTypes. func, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea how this is even possible but empirically it's not a syntax error. Babel might be dealing with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh, I can well believe that the dot operator accepts whitespace around it
@@ -262,6 +262,7 @@ module.exports = React.createClass({ | |||
items={this.state.domainToAliases[localDomain] || []} | |||
newItem={this.state.newAlias} | |||
onNewItemChanged={this.onNewAliasChanged} | |||
canEdit={this.props.canSetAliases} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced this is relevant here. canSetAliases
is always true
apparently, so this is more for clarity. canSetCanonicalAlias
is for canonical aliases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise lgtm
@@ -84,7 +84,9 @@ module.exports = React.createClass({ | |||
onNewItemChanged: PropTypes.func, | |||
onItemAdded: PropTypes.func, | |||
onItemEdited: PropTypes.func, | |||
onItemRemoved: PropTypes. func, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
heh, I can well believe that the dot operator accepts whitespace around it
@@ -262,6 +262,7 @@ module.exports = React.createClass({ | |||
items={this.state.domainToAliases[localDomain] || []} | |||
newItem={this.state.newAlias} | |||
onNewItemChanged={this.onNewAliasChanged} | |||
canEdit={this.props.canSetAliases} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the current situation is that we hardcode canSetAliases
to true
but then also never actually read it anywhere in AliasSettings
, right? We may as well either wire the thing up if it looks trivial enough to do so (which it looks like it is) or remove it.
@@ -110,6 +110,7 @@ module.exports = React.createClass({ | |||
items={this.state.newGroupsList} | |||
className={"mx_RelatedGroupSettings"} | |||
newItem={this.state.newGroupId} | |||
canEdit={this.props.canSetRelatedRooms} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably missed this in an earlier PR. but should this be canSetRelatedGroups
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep!
Fixes element-hq/element-web#5367