[1.1.53] LuaPermissionGroup has different behaviour with players in some cases

Bugs that are actually features.
Post Reply
User avatar
ZwerOxotnik
Fast Inserter
Fast Inserter
Posts: 114
Joined: Tue Dec 19, 2017 6:58 pm
Contact:

[1.1.53] LuaPermissionGroup has different behaviour with players in some cases

Post by ZwerOxotnik »

Expected:
  • Players without admin permissions can be moved to a different permission group by a mod/command/script
Steps to reproduce:
  • Create new permission groups with names like: "1", "2", "3" etc via a mod or manually
  • Demote an admin using /demote nickname
  • Change its permission group via command/script
Actual Results: Notes:

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2257
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.53] LuaPermissionGroup has different behaviour with players in some cases

Post by boskid »

Thanks for the report, however this is literally how it was implemented: LuaPermissionGroup does an extra permission check when used as part of console command: in that case it checks if player is an admin and has the EditPermissionGroup permission. There are various checks like that in code, like LuaPlayer::admin (write) will fail when used as part of console command by a player which is not an admin.

User avatar
ZwerOxotnik
Fast Inserter
Fast Inserter
Posts: 114
Joined: Tue Dec 19, 2017 6:58 pm
Contact:

Re: [1.1.53] LuaPermissionGroup has different behaviour with players in some cases

Post by ZwerOxotnik »

If I understand correctly, I just should use such actions in different events instead. (though, it seems strange)

Post Reply

Return to “Not a bug”