use uuid::Uuid; use crate::error::SpaceResult; use crate::features::SpaceService; use super::types::{CreateRoleCmd, RolePage, RoleView, UpdateRoleCmd}; use super::usecase; impl SpaceService { pub async fn create_role( &self, caller: Uuid, space_id: Uuid, cmd: CreateRoleCmd, ) -> SpaceResult { usecase::create_role(self, caller, space_id, cmd).await } pub async fn get_role( &self, caller: Option, space_id: Uuid, role_id: Uuid, ) -> SpaceResult { usecase::get_role(self, caller, space_id, role_id).await } pub async fn update_role( &self, caller: Uuid, space_id: Uuid, role_id: Uuid, cmd: UpdateRoleCmd, ) -> SpaceResult { usecase::update_role(self, caller, space_id, role_id, cmd).await } pub async fn delete_role(&self, caller: Uuid, space_id: Uuid, role_id: Uuid) -> SpaceResult<()> { usecase::delete_role(self, caller, space_id, role_id).await } pub async fn list_roles( &self, caller: Uuid, space_id: Uuid, limit: u64, offset: u64, ) -> SpaceResult { usecase::list_roles(self, caller, space_id, limit, offset).await } pub async fn assign_role( &self, caller: Uuid, space_id: Uuid, user_id: Uuid, role_id: Uuid, ) -> SpaceResult<()> { usecase::assign_role(self, caller, space_id, user_id, role_id).await } pub async fn unassign_role( &self, caller: Uuid, space_id: Uuid, user_id: Uuid, role_id: Uuid, ) -> SpaceResult<()> { usecase::unassign_role(self, caller, space_id, user_id, role_id).await } }