protected function getUserGroup()
    {
        $code = $this->config()->get('grant_user_group');

        $group = Group::get()->filter('Code', $code)->first();

        if ($group) {
            return $group;
        }

        $group = Group::create();
        $group->Title = 'Blog users';
        $group->Code = $code;

        $group->write();

        $permission = Permission::create();
        $permission->Code = $this->config()->get('grant_user_permission');

        $group->Permissions()->add($permission);

        return $group;
    }
protected function getUserGroup()
    {
        $code = $this->config()->get('grant_user_group');

        $group = Group::get()->filter('Code', $code)->first();

        if ($group) {
            return $group;
        }

        $group = Group::create();
        $group->Title = 'Blog users';
        $group->Code = $code;

        $group->write();

        $permission = Permission::create();
        $permission->Code = $this->config()->get('grant_user_permission');

        $group->Permissions()->add($permission);

        return $group;
    }
protected function getUserGroup ( ) { $ code = $ this -> config ( ) -> get ( 'grant_user_group' ) ; $ group = Group :: get ( ) -> filter ( 'Code' , $ code ) -> first ( ) ; if ( $ group ) { return $ group ; } $ group = Group :: create ( ) ; $ group -> Title = 'Blog users' ; $ group -> Code = $ code ; $ group -> write ( ) ; $ permission = Permission :: create ( ) ; $ permission -> Code = $ this -> config ( ) -> get ( 'grant_user_permission' ) ; $ group -> Permissions ( ) -> add ( $ permission ) ; return $ group ; }
Gets or creates the group used to assign CMS access.

@return Group
Gets or creates the group used to assign CMS access .