All actions enabled by the given scopes.
(&self, scopes: &[String])
| 95 | impl ApiCapability { |
| 96 | /// All actions enabled by the given scopes. |
| 97 | pub fn actions_for_scopes(&self, scopes: &[String]) -> Vec<&ApiAction> { |
| 98 | let mut result = Vec::new(); |
| 99 | for scope in scopes { |
| 100 | if let Some(actions) = self.scope_capabilities.get(scope) { |
| 101 | result.extend(actions.iter()); |
| 102 | } |
| 103 | } |
| 104 | result |
| 105 | } |
| 106 | |
| 107 | /// Write actions (POST, PUT, PATCH, DELETE) enabled by the given scopes. |
| 108 | pub fn write_actions_for_scopes(&self, scopes: &[String]) -> Vec<&ApiAction> { |
no test coverage detected