refactor(authz): permet require_permission() as has_permission(), more explicit
This commit is contained in:
@@ -257,7 +257,7 @@ pub trait FileRetrievalUseCase: Send + Sync + 'static {
|
||||
|
||||
/// Primary port for file management operations
|
||||
pub trait FileManagementUseCase: Send + Sync + 'static {
|
||||
async fn has_permission(
|
||||
async fn require_permission(
|
||||
&self,
|
||||
caller_id: Uuid,
|
||||
permission: Permission,
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::common::errors::DomainError;
|
||||
use crate::domain::services::authorization::Permission;
|
||||
|
||||
pub trait FolderUseCase: Send + Sync + 'static {
|
||||
async fn has_permission(
|
||||
async fn require_permission(
|
||||
&self,
|
||||
caller_id: Uuid,
|
||||
permission: Permission,
|
||||
|
||||
@@ -225,7 +225,7 @@ impl FileManagementService {
|
||||
}
|
||||
|
||||
impl FileManagementUseCase for FileManagementService {
|
||||
async fn has_permission(
|
||||
async fn require_permission(
|
||||
&self,
|
||||
caller_id: Uuid,
|
||||
permission: Permission,
|
||||
|
||||
@@ -41,7 +41,7 @@ impl FolderService {
|
||||
struct FolderServiceStub;
|
||||
|
||||
impl FolderUseCase for FolderServiceStub {
|
||||
async fn has_permission(
|
||||
async fn require_permission(
|
||||
&self,
|
||||
_caller_id: Uuid,
|
||||
_permission: Permission,
|
||||
@@ -175,7 +175,7 @@ impl FolderUseCase for FolderService {
|
||||
/// large request bodies (file upload, chunked upload). The authoritative
|
||||
/// check happens again inside the upload/management services before any
|
||||
/// DB write — this is a UX/resource optimization, not a security boundary.
|
||||
async fn has_permission(
|
||||
async fn require_permission(
|
||||
&self,
|
||||
caller_id: Uuid,
|
||||
permission: Permission,
|
||||
|
||||
Reference in New Issue
Block a user