mirror of
https://github.com/acepanel/panel.git
synced 2026-02-07 03:17:24 +08:00
特性:首次提交
This commit is contained in:
36
app/Http/FilesACLRepository.php
Normal file
36
app/Http/FilesACLRepository.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Alexusmai\LaravelFileManager\Services\ACLService\ACLRepository;
|
||||
|
||||
class FilesACLRepository implements ACLRepository
|
||||
{
|
||||
/**
|
||||
* Get user ID
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUserID()
|
||||
{
|
||||
return auth('sanctum')->id();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ACL rules list for user
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getRules(): array
|
||||
{
|
||||
if (auth('sanctum')->check()) {
|
||||
return [
|
||||
['disk' => 'www', 'path' => '*', 'access' => 2],
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
['disk' => 'www', 'path' => '*', 'access' => 0],
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user