/** * Create a new user * * @return integer */ public function update(array $input) { if (!$this->valid($input)) { return false; } return $this->user->update($input); }
protected function hasAccess($item) { $id = $this->user->loggedInUserId(); // User not logged in if ($id === null) { return false; } // No access key set, so we'll assume all are allowed if (!array_key_exists('access', $item)) { return true; } return $this->user->hasAccess($id, $item['access']); }