/**
  * Get all permissions from roles.
  *
  * @return \Illuminate\Database\Eloquent\Builder
  * @throws \Bican\Roles\Exceptions\RoleNotFoundException
  */
 public function rolePermissions()
 {
     if (!($roles = $this->getRoles()->lists('id'))) {
         throw new RoleNotFoundException('This user has no role.');
     }
     return Permission::select(['permissions.*', 'permission_role.created_at as pivot_created_at', 'permission_role.updated_at as pivot_updated_at'])->join('permission_role', 'permission_role.permission_id', '=', 'permissions.id')->join('roles', 'roles.id', '=', 'permission_role.role_id')->whereIn('roles.id', $roles)->orWhere('roles.level', '<', $this->level())->groupBy('permissions.id');
 }