pub enum Privilege {
ProxyView,
View,
Operate,
Manage,
Administer,
}Expand description
An access-control privilege (§6.6.1, §7.6.6–7.6.9).
Ordered from least to most: a subject granted one is granted every lower one.
ProxyView sits below View and exists for proxies, which need to see a node’s shape
without being able to read its data.
Variants§
ProxyView
Enough to observe a node through a proxy, and nothing more.
View
“SHALL support Read (if readable) and Invoke (if invocable) access” (§7.6.6).
Operate
Adds Write (§7.6.7).
Manage
Adds configuration (§7.6.8).
Administer
Everything, including the Access Control cluster itself (§7.6.9).
Implementations§
Source§impl Privilege
impl Privilege
Sourcepub const fn grants(self, required: Self) -> bool
pub const fn grants(self, required: Self) -> bool
Whether holding self grants required.
§6.6.1’s subsumption rule — with the one exception that makes it not quite a
comparison. §9.10.5.2’s chain runs View ← Operate ← Manage ← Administer, and
ProxyView is outside it: §6.6.6.2’s add_granted_privilege expands Operate,
Manage and Administer downward to View and never mentions ProxyView, so nothing grants
it but itself and it grants nothing else.
Treating the five as totally ordered would hand every View holder a privilege the
specification never gives them — quietly, and in the permissive direction. The Ord
derive still orders them for convenience; this is the access decision, and
Acl::granted agrees with it.