Jump to:

3429 Posts in 1057 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Specific member group on ModelAdmin in SS3

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 308 Views
  • sajok
    Avatar
    Community Member
    82 Posts

    Specific member group on ModelAdmin in SS3 Link to this post

    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

    308 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.