You are here

public function RestfulEntityBaseUser::getList in RESTful 7

Overrides \RestfulEntityBase::getList().

Make sure only privileged users may see a list of users.

Overrides RestfulEntityBase::getList

File

plugins/restful/RestfulEntityBaseUser.php, line 40
Contains RestfulEntityBaseUser.

Class

RestfulEntityBaseUser
@file Contains RestfulEntityBaseUser.

Code

public function getList() {
  $account = $this
    ->getAccount();
  if (!user_access('administer users', $account) && !user_access('access user profiles', $account)) {
    throw new \RestfulForbiddenException('You do not have access to listing of users.');
  }
  return parent::getList();
}