This is how to applyGlobalPermission: $this->applyGlobalPermission($applyGroupId, $applyPermissionId, $dependGroupId = null, $dependPermissionId = null)
This is how to applyGlobalPermission: $this->applyGlobalPermission($applyGroupId, $applyPermissionId, $dependGroupId = null, $dependPermissionId = null)
public function installStep1()
{
$this->applyGlobalPermission('forum', 'postThread');
}
This is the correct code
The remainder of the two parameters are used if you want to only grant the permission to user groups who already have another permission.
For instance, if you want to grant customPermissionGroup - customPermissionId permission if someone already has post thread permissions, you'd do $this->applyGlobalPermission('customPermissionGroup', 'customPermissionId', 'forum', 'postThread');
Thank you both for the help.
I managed to finally figure it out, but have 1 more question about this.
Is it possible to just set the default permission for the admin group and not the rest using this method?
Does anyone know if there's a way to do this without a setup file entry? My add-on I'm fixing to release does not need a setup file and I want to set my permissions to default 'yes' when they install it.
Any ideas? @Chris D ? I'm working on a most users ever online add-on and I'm almost done with it. It's a really great add-on and even implements a widget and options for putting the counts under members online. It's got counts for all users, members, and even guests. I'm almost done with it but I don't know how to setup default permissions set to 'yes'.
EDIT: Nevermind, the issue I just posted about was because for some reason the setup file made permissions on the actual user (staff members) and not just the usergroup. Anyways I'd rather not take that route Chris but I appreciate the info.
EDIT: I actually think I may give this a try. Shouldn't be a big deal to setup.
@Chris D does this only work when when you build your add-on and install it the normal way? I ran the installStep1() with the code in it, replacing my permission group ID and permission ID and it switched them all to 'yes' but it doesn't work until I click save. Any idea?