OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
26
app/Core/Auth/Contracts/ChecksProjectAccess.php
Normal file
26
app/Core/Auth/Contracts/ChecksProjectAccess.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Core\Auth\Contracts;
|
||||
|
||||
/**
|
||||
* Narrow contract the permission engine depends on for project-level data access and the
|
||||
* per-project role, implemented by the Projects domain service.
|
||||
*
|
||||
* The engine lives in Core and must not depend on the 2,900-line Projects god-service
|
||||
* directly; it depends on this abstraction (bound to Projects in PermissionServiceProvider),
|
||||
* which also keeps the surface small and sidesteps circular-reference risk.
|
||||
*/
|
||||
interface ChecksProjectAccess
|
||||
{
|
||||
/**
|
||||
* Whether the user can access the given project (assigned, or via the project's
|
||||
* `psettings` — admin/owner bypass handled by the implementation/engine).
|
||||
*/
|
||||
public function isUserAssignedToProject(int $userId, int $projectId): bool;
|
||||
|
||||
/**
|
||||
* The user's explicit role within the project, or '' when none is set (inherits global).
|
||||
* Returns the stored role key as a string.
|
||||
*/
|
||||
public function getProjectRole(int $userId, int $projectId): string;
|
||||
}
|
||||
Reference in New Issue
Block a user