mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
separate route permission + token manage
This commit is contained in:
@@ -41,8 +41,8 @@ class ExamResource extends JsonResource
|
||||
{
|
||||
$filters = $exam->filters;
|
||||
foreach (Exam::$filters as $key => $value) {
|
||||
if (!isset($filters->$key)) {
|
||||
$filters->$key = [];
|
||||
if (!isset($filters[$key])) {
|
||||
$filters[$key] = [];
|
||||
}
|
||||
}
|
||||
return $filters;
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Auth\Permission;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class UserResource extends JsonResource
|
||||
{
|
||||
@@ -18,7 +20,7 @@ class UserResource extends JsonResource
|
||||
$out = [
|
||||
'id' => $this->id,
|
||||
'username' => $this->username,
|
||||
'email' => $this->email,
|
||||
'email' => $this->when(Gate::allows("viewEmail", $this->resource), $this->email),
|
||||
'status' => $this->status,
|
||||
'enabled' => $this->enabled,
|
||||
'added' => format_datetime($this->added),
|
||||
|
||||
Reference in New Issue
Block a user