Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
40252d13
Unverified
Commit
40252d13
authored
6 years ago
by
Erik Johnston
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #3474 from matrix-org/erikj/py3_auth
Fix up auth check
parents
508196e0
f88dea57
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/3474.misc
+0
-0
0 additions, 0 deletions
changelog.d/3474.misc
synapse/event_auth.py
+6
-1
6 additions, 1 deletion
synapse/event_auth.py
with
6 additions
and
1 deletion
changelog.d/3474.misc
0 → 100644
+
0
−
0
View file @
40252d13
This diff is collapsed.
Click to expand it.
synapse/event_auth.py
+
6
−
1
View file @
40252d13
...
...
@@ -76,6 +76,7 @@ def check(event, auth_events, do_sig_check=True, do_size_check=True):
return
if
event
.
type
==
EventTypes
.
Create
:
sender_domain
=
get_domain_from_id
(
event
.
sender
)
room_id_domain
=
get_domain_from_id
(
event
.
room_id
)
if
room_id_domain
!=
sender_domain
:
raise
AuthError
(
...
...
@@ -524,7 +525,11 @@ def _check_power_levels(event, auth_events):
"
to your own
"
)
if
old_level
>
user_level
or
new_level
>
user_level
:
# Check if the old and new levels are greater than the user level
# (if defined)
old_level_too_big
=
old_level
is
not
None
and
old_level
>
user_level
new_level_too_big
=
new_level
is
not
None
and
new_level
>
user_level
if
old_level_too_big
or
new_level_too_big
:
raise
AuthError
(
403
,
"
You don
'
t have permission to add ops level greater
"
...
...
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