nullsense
nullsense2w ago

[Bug]: Searching User Grants by RoleKey Prefix Not Enabled (dead code)

Not sure how to get attention on bugs that seem to have breaking functionality. Posting the following bug that I opened a Github Issue for. Any insight into this would be greatly appreciated. https://github.com/zitadel/zitadel/issues/11018
GitHub
[Bug]: Searching User Grants by RoleKey Prefix Not Enabled (dead co...
Preflight Checklist I could not find a solution in the documentation, the existing issues or discussions I have joined the ZITADEL chat Environment Self-hosted Version 2.71.10 Database PostgreSQL D...
8 Replies
Ask Inkeep
Ask Inkeep2w ago
Hi @Billy, I'm an AI assistant for ZITADEL. While a team member reviews this question, I'll see if I can find relevant sources for your question. Answer I wasn't able to find a direct answer, here are some relevant sources: 1. Search User Grants (1) : This documentation covers the Search User Grants endpoint which includes the roleKeyQuery parameter with various text query methods including TEXT_QUERY_METHOD_STARTS_WITH and TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE. 2. [Bug]: User Grants are not persisted after action call in external authentication trigger type post creation (2) : This shows a closed GitHub issue related to user grants functionality that might provide context on similar issues. If you'd like help from a team member to investigate the specific bug you've reported, you can click the "Ask for help" button to tag someone to review your GitHub issue. ​ To learn more, see the sources I considered: [1] Search User Grants [2] [Bug]: User Grants are not persisted after action call in external authentication trigger type post creation ​ Feel free to tag @Ask Inkeep with additional questions. Got it. Tagging @Rajat for additional help.
Rajat
Rajat2w ago
hey @nullsense thanks for creating a ticket. I will take it internally and will also test it myself.
nullsense
nullsenseOP5d ago
@Rajat Great! Let me know your findings whenever you can. @Rajat bump
Rajat
Rajat4d ago
hey @nullsense I will test it today and will get back to you. Apologies for the delay
Rajat
Rajat4d ago
hey @nullsense I tried it and worked for me, exact same query came back with search results.
userGrantResp, err := client.ListUserGrants(ctx, &mgmtpb.ListUserGrantRequest{
Query: &object.ListQuery{
Offset: 0,
Limit: 2,
Asc: false,
},
Queries: []*user.UserGrantQuery{
{
Query: &user.UserGrantQuery_ProjectIdQuery{
ProjectIdQuery: &user.UserGrantProjectIDQuery{
ProjectId: "299415855849057024",
},
},
},
{
Query: &user.UserGrantQuery_UserIdQuery{
UserIdQuery: &user.UserGrantUserIDQuery{
UserId: "299415687775496960",
},
},
},
{
Query: &user.UserGrantQuery_RoleKeyQuery{
RoleKeyQuery: &user.UserGrantRoleKeyQuery{
RoleKey: "example_",
Method: object.TextQueryMethod_TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE,
},
},
},
},
})
userGrantResp, err := client.ListUserGrants(ctx, &mgmtpb.ListUserGrantRequest{
Query: &object.ListQuery{
Offset: 0,
Limit: 2,
Asc: false,
},
Queries: []*user.UserGrantQuery{
{
Query: &user.UserGrantQuery_ProjectIdQuery{
ProjectIdQuery: &user.UserGrantProjectIDQuery{
ProjectId: "299415855849057024",
},
},
},
{
Query: &user.UserGrantQuery_UserIdQuery{
UserIdQuery: &user.UserGrantUserIDQuery{
UserId: "299415687775496960",
},
},
},
{
Query: &user.UserGrantQuery_RoleKeyQuery{
RoleKeyQuery: &user.UserGrantRoleKeyQuery{
RoleKey: "example_",
Method: object.TextQueryMethod_TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE,
},
},
},
},
})
and the response I have attached in the screenshot. As you can see the role name was example_role and I am able to see it in my response.
No description
nullsense
nullsenseOP4d ago
@Rajat 🤔 Would you be able to share which version you tested this on
Rajat
Rajat4d ago
hey @Billy this was v4.6.4 on cloud
nullsense
nullsenseOP4d ago
There’s no way to test on 2.71.10 eh? (We aren’t ready to migrate off of v2 yet) @Rajat

Did you find this page helpful?