API changes

This commit is contained in:
Hillel Coren 2016-08-17 17:29:25 +03:00
parent 2f5235f1f0
commit 6f6a475633
2 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@ class ApiCheck {
// check if user is archived // check if user is archived
if ($token && $token->user) { if ($token && $token->user) {
Auth::loginUsingId($token->user_id); Auth::onceUsingId($token->user_id);
Session::set('token_id', $token->id); Session::set('token_id', $token->id);
} else { } else {
sleep(ERROR_DELAY); sleep(ERROR_DELAY);

View File

@ -2,9 +2,9 @@
use Auth; use Auth;
class UpdateUserRequest extends Request class UpdateUserRequest extends EntityReques
{ {
// Expenses // Expenses
/** /**
* Determine if the user is authorized to make this request. * Determine if the user is authorized to make this request.
* *
@ -12,7 +12,7 @@ class UpdateUserRequest extends Request
*/ */
public function authorize() public function authorize()
{ {
return $this->user()->can('edit', $this->entity()); return Auth::user()->is_admin || $this->user()->id == Auth::user()->id;
} }
/** /**