I'm trying to programmatically set group permissions. I came across the method saveGroupPermissions(). According to the documentation all you have to do is pass in the group ID and then an array of the permissions you want to apply. Great, seems simple enough. So I attempted the following:
accesssitewhensystemisoff is a built-in Craft permission, I'm not attempting to set my own custom permission... Not even sure if that's possible but we'll save that discussion for later.
Anyway this is not working and I have no idea why. There are literally zero examples of how to properly do this so I'm wondering if anyone else has solved this problem?
On a related note does anyone know if it's possible to set a group permission that gives access to a plugin? Or do I need to whip up my own plugin to handle that?