Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add defense in ldap:get_roles_for_user_and_project
LDAP:get_roles_for_user_and_project will raise "Could not find user" exception when you try to get roles by user(user was in a group) and project. In this patch: 1. Add defense in assignment.backends.ldap.Assignment::_get_metadata(), return empty dict rather than throw exception when userid==None or tenantid==None. 2. Remove checking existance of tenant_id and user_id logic, because these logics were always done before this method being called. 3. Add testcase test_get_role_by_user_and_project_with_user_in_group in test_backend module. Fixes bug #1204221 Change-Id: I68c39afddde4065fc61ffb9451592c5108dc138b
- Loading branch information
1 parent
9c92d27
commit 5e7a567
Showing
2 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters