| 56 | |
| 57 | |
| 58 | vector<string> ancestors(const string& role) |
| 59 | { |
| 60 | vector<string> result; |
| 61 | |
| 62 | for (int i = role.size() - 1; i >= 0; --i) { |
| 63 | if (role[i] == '/') { |
| 64 | result.push_back(role.substr(0, i)); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | return result; |
| 69 | } |
| 70 | |
| 71 | |
| 72 | // TODO(haosdent): Pull this out into `stout` and make it satisfy all |