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

330 Views

Avatar
sajok

21 April 2013 at 12:54am Community Member, 82 Posts

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