2017 © Pedro Peláez
 

silverstripe-module silverstripe-defaultgroups

Programmatically define default groups

image

titledk/silverstripe-defaultgroups

Programmatically define default groups

  • Friday, March 31, 2017
  • by titledk
  • Repository
  • 2 Watchers
  • 0 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Default Groups

Programmatically define default groups, (*1)

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'
            )
        );      

    }
}

The Versions

31/03 2017

dev-master

9999999-dev https://github.com/titledk/silverstripe-defaultgroups

Programmatically define default groups

  Sources   Download

MIT

The Requires

 

app security silverstripe