Commit 000ee36
CLOUDSTACK-9971: Bugfix/listaccounts parameter consistency (#2156)
Ran into an issue today where we passed both the "id" and "domainid" parameters into "listAccounts" and received a response despite the account id passed not belonging to the domainid passed.
Allow usage of "domainid" AND "id" in "listAccounts"
- Adding "AccountDoa::findActiveAccountById"
- Adding "AccountDaoImpl::findActiveAccountById"
- Removing seemingly pointless "listForDomain" parameter
- Updating "typeNEQ" value from "5" to "Account.ACCOUNT_TYPE_PROJECT"
(which is "5")
- Only attempt to load domain for "path" query parameter once
"searchForAccountsInternal" input validation logic pseudo-code:
- If "domainid" set, check immediately
- If "id" not set:
- and user is admin and "listall" is true
- if "domainid" not set, use caller domain id
- force "isrecursive" true
- else use caller account id
- Else if "domainid" and "name" set
- verify existence of account and that user has access
- Else:
- if "domainid" not set, locate account by "id"
- else, locate account by "id" and "domainid"
- verify account found and caller has access rights1 parent c436bc3 commit 000ee36
3 files changed
Lines changed: 66 additions & 45 deletions
File tree
- engine/schema/src/com/cloud/user/dao
- server/src/com/cloud/api/query
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 19 | | |
29 | 20 | | |
30 | 21 | | |
| |||
39 | 30 | | |
40 | 31 | | |
41 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
| |||
188 | 186 | | |
189 | 187 | | |
190 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
191 | 196 | | |
192 | 197 | | |
193 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1982 | 1982 | | |
1983 | 1983 | | |
1984 | 1984 | | |
1985 | | - | |
1986 | | - | |
1987 | | - | |
1988 | | - | |
1989 | | - | |
1990 | | - | |
1991 | | - | |
1992 | | - | |
1993 | | - | |
1994 | | - | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
1995 | 1988 | | |
| 1989 | + | |
1996 | 1990 | | |
1997 | | - | |
| 1991 | + | |
| 1992 | + | |
1998 | 1993 | | |
1999 | 1994 | | |
2000 | 1995 | | |
2001 | | - | |
| 1996 | + | |
2002 | 1997 | | |
2003 | | - | |
2004 | | - | |
2005 | | - | |
2006 | | - | |
2007 | | - | |
2008 | | - | |
2009 | | - | |
2010 | | - | |
2011 | | - | |
2012 | 1998 | | |
2013 | 1999 | | |
| 2000 | + | |
2014 | 2001 | | |
2015 | | - | |
2016 | | - | |
2017 | | - | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
2018 | 2005 | | |
2019 | 2006 | | |
2020 | 2007 | | |
2021 | | - | |
2022 | | - | |
2023 | | - | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
2024 | 2011 | | |
2025 | 2012 | | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
2026 | 2037 | | |
2027 | 2038 | | |
2028 | 2039 | | |
| |||
2042 | 2053 | | |
2043 | 2054 | | |
2044 | 2055 | | |
2045 | | - | |
| 2056 | + | |
2046 | 2057 | | |
2047 | 2058 | | |
2048 | 2059 | | |
2049 | 2060 | | |
2050 | 2061 | | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
2051 | 2065 | | |
2052 | 2066 | | |
2053 | 2067 | | |
| |||
2073 | 2087 | | |
2074 | 2088 | | |
2075 | 2089 | | |
2076 | | - | |
2077 | | - | |
2078 | | - | |
2079 | 2090 | | |
2080 | 2091 | | |
2081 | 2092 | | |
2082 | 2093 | | |
2083 | | - | |
| 2094 | + | |
2084 | 2095 | | |
2085 | | - | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
2086 | 2100 | | |
2087 | 2101 | | |
2088 | 2102 | | |
| |||
0 commit comments