mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
API changes
This commit is contained in:
parent
2f5235f1f0
commit
6f6a475633
@ -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);
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user