Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions /

Specific member group on ModelAdmin in SS3


Reply


414 Views

Avatar
sajok

Community Member, 82 Posts

21 April 2013 at 12:54am

Hello,

I created a group for "Students", and I want to have a ModelAdmin section that lists only members from group "Students". Using the following code lists all site members:

class StudentsAdmin extends ModelAdmin {
public static $managed_models = array('Member');
static $url_segment = 'Students';
static $menu_title = 'Students';

public function getList() {
$list = parent::getList();
// ...
return $list;
}
}

I'm trying to use the getList() function to exclude all groups except Students group, something like:

$list->exclude('Group', 'Admins');

any help how I can do this?

Thanks