public function set_default(): void
    {
        if (!userHasPermission('admin:auth:groups:setDefault')) {
            show404();
        }

        $oUri            = Factory::service('Uri');
        $oUserGroupModel = Factory::model('UserGroup', 'nails/module-auth');
        $oSession        = Factory::service('Session', 'nails/module-auth');

        if ($oUserGroupModel->setAsDefault($oUri->segment(5))) {
            $oSession->setFlashData(
                'success',
                'Group set as default successfully.'
            );
        } else {
            $oSession->setFlashData(
                'error',
                'Failed to set default user group. ' . $oUserGroupModel->lastError()
            );
        }

        redirect('admin/auth/groups');
    }
public function set_default(): void
    {
        if (!userHasPermission('admin:auth:groups:setDefault')) {
            show404();
        }

        $oUri            = Factory::service('Uri');
        $oUserGroupModel = Factory::model('UserGroup', 'nails/module-auth');
        $oSession        = Factory::service('Session', 'nails/module-auth');

        if ($oUserGroupModel->setAsDefault($oUri->segment(5))) {
            $oSession->setFlashData(
                'success',
                'Group set as default successfully.'
            );
        } else {
            $oSession->setFlashData(
                'error',
                'Failed to set default user group. ' . $oUserGroupModel->lastError()
            );
        }

        redirect('admin/auth/groups');
    }
public function set_default ( ) : void { if ( ! userHasPermission ( 'admin:auth:groups:setDefault' ) ) { show404 ( ) ; } $ oUri = Factory :: service ( 'Uri' ) ; $ oUserGroupModel = Factory :: model ( 'UserGroup' , 'nails/module-auth' ) ; $ oSession = Factory :: service ( 'Session' , 'nails/module-auth' ) ; if ( $ oUserGroupModel -> setAsDefault ( $ oUri -> segment ( 5 ) ) ) { $ oSession -> setFlashData ( 'success' , 'Group set as default successfully.' ) ; } else { $ oSession -> setFlashData ( 'error' , 'Failed to set default user group. ' . $ oUserGroupModel -> lastError ( ) ) ; } redirect ( 'admin/auth/groups' ) ; }
Set the default user group

@return void
Set the default user group