Check if this permission implies another permission.
(&self, other: &DelegationPermission)
| 116 | |
| 117 | /// Check if this permission implies another permission. |
| 118 | pub fn implies(&self, other: &DelegationPermission) -> bool { |
| 119 | match self { |
| 120 | DelegationPermission::Full => true, |
| 121 | DelegationPermission::Admin => matches!( |
| 122 | other, |
| 123 | DelegationPermission::Read |
| 124 | | DelegationPermission::ManageViews |
| 125 | | DelegationPermission::ManageTags |
| 126 | | DelegationPermission::Admin |
| 127 | ), |
| 128 | _ => self == other, |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | /// Get all standard permissions (excluding Full). |
| 133 | pub fn standard_permissions() -> &'static [DelegationPermission] { |