Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
7936d2a9
Unverified
Commit
7936d2a9
authored
5 years ago
by
Patrick Cloke
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Publishing/removing from the directory requires a power level greater than canonical aliases.
parent
509e381a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/6965.feature
+1
-0
1 addition, 0 deletions
changelog.d/6965.feature
synapse/api/auth.py
+5
-5
5 additions, 5 deletions
synapse/api/auth.py
with
6 additions
and
5 deletions
changelog.d/6965.feature
0 → 100644
+
1
−
0
View file @
7936d2a9
Publishing/removing
a
room from the room directory now requires the user to have a power level capable of modifying the canonical alias, instead of the room aliases.
This diff is collapsed.
Click to expand it.
synapse/api/auth.py
+
5
−
5
View file @
7936d2a9
...
...
@@ -538,13 +538,13 @@ class Auth(object):
return
defer
.
succeed
(
auth_ids
)
@defer.inlineCallbacks
def
check_can_change_room_list
(
self
,
room_id
,
user
):
def
check_can_change_room_list
(
self
,
room_id
:
str
,
user
:
UserID
):
"""
Check if the user is allowed to edit the room
'
s entry in the
published room list.
Args:
room_id
(str)
user
(UserID)
room_id
user
"""
is_admin
=
yield
self
.
is_server_admin
(
user
)
...
...
@@ -556,7 +556,7 @@ class Auth(object):
# We currently require the user is a "moderator" in the room. We do this
# by checking if they would (theoretically) be able to change the
# m.room.alias
es
events
# m.room.
canonical_
alias events
power_level_event
=
yield
self
.
state
.
get_current_state
(
room_id
,
EventTypes
.
PowerLevels
,
""
)
...
...
@@ -566,7 +566,7 @@ class Auth(object):
auth_events
[(
EventTypes
.
PowerLevels
,
""
)]
=
power_level_event
send_level
=
event_auth
.
get_send_level
(
EventTypes
.
Alias
es
,
""
,
power_level_event
EventTypes
.
Canonical
Alias
,
""
,
power_level_event
)
user_level
=
event_auth
.
get_user_power_level
(
user_id
,
auth_events
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment