3
有什麼方法可以記錄請求所需的權限嗎?如果我有註解像swagger - 註解權限?
[Authenticate]
[RequiredRole("Admin")]
[RequiredPermission("CanAccess")]
public object Delete(DeleteAppUser deleteUserRequest)
{
// ....
}
在我的服務類
或者用於我RequestDTOs
[Authenticate]
[RequiredRole("Admin")]
[Route("/appusers/{AppUserId}", "DELETE", Summary = "Delete an application user identified by its ID.")]
public class DeleteAppUser : IReturn<AppUserDto>
{
// ....
}
我可以做出這樣招搖的UI文檔中莫名其妙地支持我的API的用戶自動或做我有把它寫在註釋中,例如:
[Route("/appusers/{AppUserId}", "DELETE", Summary = "Delete an application user identified by its ID.", Notes="Requires an authenticated session and membership in the Admin role.")]