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
Package registry
Container Registry
Model registry
Operate
Terraform modules
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
Timo Ley
synapse
Commits
55fcf62e
Commit
55fcf62e
authored
9 years ago
by
Mark Haines
Browse files
Options
Downloads
Plain Diff
Merge pull request #133 from matrix-org/invite_power_level
Invite power level
parents
252e6f68
38432d8c
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
synapse/api/auth.py
+8
-0
8 additions, 0 deletions
synapse/api/auth.py
synapse/handlers/room.py
+2
-1
2 additions, 1 deletion
synapse/handlers/room.py
with
10 additions
and
1 deletion
synapse/api/auth.py
+
8
−
0
View file @
55fcf62e
...
...
@@ -222,6 +222,13 @@ class Auth(object):
elif
target_in_room
:
# the target is already in the room.
raise
AuthError
(
403
,
"
%s is already in the room.
"
%
target_user_id
)
else
:
invite_level
=
self
.
_get_named_level
(
auth_events
,
"
invite
"
,
0
)
if
user_level
<
invite_level
:
raise
AuthError
(
403
,
"
You cannot invite user %s.
"
%
target_user_id
)
elif
Membership
.
JOIN
==
membership
:
# Joins are valid iff caller == target and they were:
# invited: They are accepting the invitation
...
...
@@ -561,6 +568,7 @@ class Auth(object):
(
"
ban
"
,
[]),
(
"
redact
"
,
[]),
(
"
kick
"
,
[]),
(
"
invite
"
,
[]),
]
old_list
=
current_state
.
content
.
get
(
"
users
"
)
...
...
This diff is collapsed.
Click to expand it.
synapse/handlers/room.py
+
2
−
1
View file @
55fcf62e
...
...
@@ -213,7 +213,8 @@ class RoomCreationHandler(BaseHandler):
"
state_default
"
:
50
,
"
ban
"
:
50
,
"
kick
"
:
50
,
"
redact
"
:
50
"
redact
"
:
50
,
"
invite
"
:
0
,
},
)
...
...
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