titledk / silverstripe-defaultgroups
Programmatically define default groups
Installs: 113
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 2
Open Issues: 0
Type:silverstripe-module
Requires
- silverstripe/framework: ~3.1
This package is not auto-updated.
Last update: 2024-12-19 01:20:30 UTC
README
Programmatically define default groups
Can be added to a member extension like this:
class MemberExtension extends DataExtension { const APP_ADMIN_GROUP_CODE = 'app-admins'; const APP_USER_GROUP_CODE = 'app-users'; public function requireDefaultRecords() { parent::requireDefaultRecords(); DefaultGroupsHelper::default_group( MemberExtension::APP_USER_GROUP_CODE, //group code _t('MemberExtension.AppUsers','App Users'), //group name null, //parent code null //permissions ); DefaultGroupsHelper::default_group( MemberExtension::APP_ADMIN_GROUP_CODE, //group code _t('MemberExtension.AppAdministrators','App Administrators'), //group name MemberExtension::APP_USER_GROUP_CODE, // parent code //permissions: array( 'APP_ACCESS_ADMIN' ) ); } }