Check if this permission implies another permission.
(&self, other: &DelegationPermission)
| 108 | |
| 109 | /// Check if this permission implies another permission. |
| 110 | pub fn implies(&self, other: &DelegationPermission) -> bool { |
| 111 | match self { |
| 112 | DelegationPermission::Full => true, |
| 113 | DelegationPermission::Admin => matches!( |
| 114 | other, |
| 115 | DelegationPermission::Read |
| 116 | | DelegationPermission::ManageStacks |
| 117 | | DelegationPermission::ManageTags |
| 118 | | DelegationPermission::Admin |
| 119 | ), |
| 120 | _ => self == other, |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | /// Get all standard permissions (excluding Full). |
| 125 | pub fn standard_permissions() -> &'static [DelegationPermission] { |