Change the default power levels to be 0, 50 and 100

This commit is contained in:
Erik Johnston 2014-09-04 16:16:26 +01:00
parent 9f633bc125
commit 95037d8d9d
2 changed files with 10 additions and 10 deletions

View File

@ -172,7 +172,7 @@ class Auth(object):
if kick_level: if kick_level:
kick_level = int(kick_level) kick_level = int(kick_level)
else: else:
kick_level = 5 kick_level = 50
if user_level < kick_level: if user_level < kick_level:
raise AuthError( raise AuthError(
@ -189,7 +189,7 @@ class Auth(object):
if ban_level: if ban_level:
ban_level = int(ban_level) ban_level = int(ban_level)
else: else:
ban_level = 5 # FIXME (erikj): What should we do here? ban_level = 50 # FIXME (erikj): What should we do here?
if user_level < ban_level: if user_level < ban_level:
raise AuthError(403, "You don't have permission to ban") raise AuthError(403, "You don't have permission to ban")

View File

@ -132,7 +132,7 @@ class RoomCreationHandler(BaseRoomHandler):
etype=RoomNameEvent.TYPE, etype=RoomNameEvent.TYPE,
room_id=room_id, room_id=room_id,
user_id=user_id, user_id=user_id,
required_power_level=5, required_power_level=50,
content={"name": name}, content={"name": name},
) )
@ -143,7 +143,7 @@ class RoomCreationHandler(BaseRoomHandler):
etype=RoomNameEvent.TYPE, etype=RoomNameEvent.TYPE,
room_id=room_id, room_id=room_id,
user_id=user_id, user_id=user_id,
required_power_level=5, required_power_level=50,
content={"name": name}, content={"name": name},
) )
@ -155,7 +155,7 @@ class RoomCreationHandler(BaseRoomHandler):
etype=RoomTopicEvent.TYPE, etype=RoomTopicEvent.TYPE,
room_id=room_id, room_id=room_id,
user_id=user_id, user_id=user_id,
required_power_level=5, required_power_level=50,
content={"topic": topic}, content={"topic": topic},
) )
@ -186,7 +186,7 @@ class RoomCreationHandler(BaseRoomHandler):
event_keys = { event_keys = {
"room_id": room_id, "room_id": room_id,
"user_id": creator.to_string(), "user_id": creator.to_string(),
"required_power_level": 10, "required_power_level": 100,
} }
def create(etype, **content): def create(etype, **content):
@ -203,7 +203,7 @@ class RoomCreationHandler(BaseRoomHandler):
power_levels_event = self.event_factory.create_event( power_levels_event = self.event_factory.create_event(
etype=RoomPowerLevelsEvent.TYPE, etype=RoomPowerLevelsEvent.TYPE,
content={creator.to_string(): 10, "default": 0}, content={creator.to_string(): 100, "default": 0},
**event_keys **event_keys
) )
@ -215,7 +215,7 @@ class RoomCreationHandler(BaseRoomHandler):
add_state_event = create( add_state_event = create(
etype=RoomAddStateLevelEvent.TYPE, etype=RoomAddStateLevelEvent.TYPE,
level=10, level=100,
) )
send_event = create( send_event = create(
@ -225,8 +225,8 @@ class RoomCreationHandler(BaseRoomHandler):
ops = create( ops = create(
etype=RoomOpsPowerLevelsEvent.TYPE, etype=RoomOpsPowerLevelsEvent.TYPE,
ban_level=5, ban_level=50,
kick_level=5, kick_level=50,
) )
return [ return [