| 583 | |
| 584 | |
| 585 | int BZFSHTTPAuth::getLevelFromGroups(const std::vector<std::string> &groups) { |
| 586 | std::map<int, std::vector<std::string> >::reverse_iterator itr = authLevels.rbegin(); |
| 587 | |
| 588 | while (itr != authLevels.rend()) { |
| 589 | for (size_t s = 0; s < itr->second.size(); s++) { |
| 590 | std::string& perm = itr->second[s]; |
| 591 | |
| 592 | std::vector<std::string> groupsWithPerm; |
| 593 | |
| 594 | if (compare_nocase(perm, "ADMIN") == 0) { |
| 595 | groupsWithPerm = findGroupsWithAdmin(); |
| 596 | } |
| 597 | else { |
| 598 | groupsWithPerm = findGroupsWithPerm(perm); |
| 599 | } |
| 600 | |
| 601 | // check the input groups, and see if any of the them are in the groups with this perm |
| 602 | for (size_t i = 1; i < groups.size(); i++) { |
| 603 | if (stringInList(groups[i], groupsWithPerm)) { |
| 604 | return itr->first; |
| 605 | } |
| 606 | } |
| 607 | } |
| 608 | itr++; |
| 609 | } |
| 610 | return 0; |
| 611 | } |
| 612 | |
| 613 | void BZFSHTTPAuth::flushTasks(void) { |
| 614 | std::map<int, AuthInfo>::iterator authItr = authedSessions.begin(); |
nothing calls this directly
no test coverage detected