This is NOT something I am particularly familiar with but in the absence of answers from better-informed users...
Typically integration between desktop and shutdown (along with some other stuff) is handled via polkit. IMHO, polkit is not well documented. However the Arch Wiki does have some useful stuff which includes the specific example of how to disable hibernate. Hence for your scenario, something like....
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.login1.suspend" ||
action.id == "org.freedesktop.login1.suspend-multiple-sessions" ||
action.id == "org.freedesktop.login1.hibernate" ||
action.id == "org.freedesktop.login1.hibernate-multiple-sessions" ||
action.id == "org.freedesktop.login1.hibernate-ignore-inhibit")
{
return polkit.Result.YES;
}
});
This should be redundant as the default policy should allow users to invoke hibernate. The default policy should be in /usr/share/polkit-1/actions/org.freedesktop.login1.policy. It is possible that "Sway" tries to do something unusual to invoke hibernate. You can test the D-Bus/polkit mechanism using systemctl suspend-then-hibernate
at the shell.