Added Character-level quelling possibilities to superuser. This makes the superuser quelling completely in line with normal quelling for other permission levels. It also removes the need for the special _superuser_character bypass used before (the migration no longer creates it an initial_setup won't either).
This commit is contained in:
parent
77a0b47859
commit
f00053710c
5 changed files with 30 additions and 33 deletions
|
|
@ -28,7 +28,7 @@ class Migration(DataMigration):
|
|||
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
|
||||
|
||||
lockstring = "attrread:perm(Admins);attredit:perm(Admins);attrcreate:perm(Admins)"
|
||||
lockstring2 = "attrread:false();attredit:false();attrcreate:false()"
|
||||
#lockstring2 = "attrread:false();attredit:false();attrcreate:false()"
|
||||
if not db.dry_run:
|
||||
for player in orm['players.PlayerDB'].objects.all():
|
||||
char = player.db_obj
|
||||
|
|
@ -47,14 +47,15 @@ class Migration(DataMigration):
|
|||
db_value=val)
|
||||
|
||||
suser = char and char.id == 1
|
||||
if suser:
|
||||
# move the superuser unmask attribute for the superuser (note that this
|
||||
# is not a security risk, it only works if player's superuser bit is set too)
|
||||
val = pickle.dumps(("simple", suser))
|
||||
orm['objects.ObjAttribute'].objects.create(db_key="_superuser_character",
|
||||
db_obj=char,
|
||||
db_lock_storage=lockstring2,
|
||||
db_value=val)
|
||||
#if suser:
|
||||
# # REMOVED - this is not needed - Griatch
|
||||
# # the superuser unmask attribute for the superuser (note that this
|
||||
# # is not a security risk, it only works if player's superuser bit is set too)
|
||||
# val = pickle.dumps(("simple", suser))
|
||||
# orm['objects.ObjAttribute'].objects.create(db_key="_superuser_character",
|
||||
# db_obj=char,
|
||||
# db_lock_storage=lockstring2,
|
||||
# db_value=val)
|
||||
|
||||
|
||||
def backwards(self, orm):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue