Release 1.0.0
This release is a complete rework of permissions. Reason is need for async, no request extractor logic, and lifetime limitations.
Changed
-
Permission
call
signature. Instead ofcall(&req, &mut payload)
, it is nowcall(req, args)
. -
Permission
supports async functions and there's no need for data extractors. Works same as actixHandler
. You can no write something like
async fn dummy_permission_check(
_req: HttpRequest,
dummy_service: web::Data<DummyService>,
data: web::Query<MyStatus>,
) -> actix_web::Result<bool> {
// Unecessary complicating permission check to show what it can do.
// You have access to request, payload, and all injected dependencies through app_data.
Ok(dummy_service.check(data.status.clone()))
}
Removed
Builder
removed. No more composing different permissions.check
method accepts aPermission
instead ofBuilder
, and would look likecheck(web::get(), dummy_permission_check, index))