Skip to main content

Module authz

Module authz 

Source

Functionsยง

can_read_crate
Whether user may see a crate and its metadata, honoring its download restriction. None is an anonymous caller, who only sees unrestricted crates.
crate_visibility
Which download-restricted crates user may see in crate listings.
has_restricted_crate_access
Whether user may read the content of a download-restricted crate, i.e. the crate archive and its hosted rustdoc.
require_admin
Fail unless user is an admin.
require_owner
Fail unless user owns the crate or is an admin.
require_writable
Fail if user is read-only. Admins can always modify, as they can change their read-only state anyway.