mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 11:07:32 +00:00
feat: get my project permission (#245)
This commit is contained in:
@@ -81,6 +81,19 @@ func (repo *UserGrantRepo) SearchMyZitadelPermissions(ctx context.Context) ([]st
|
||||
return permissions.Permissions, nil
|
||||
}
|
||||
|
||||
func (repo *UserGrantRepo) SearchMyProjectPermissions(ctx context.Context) ([]string, error) {
|
||||
ctxData := auth.GetCtxData(ctx)
|
||||
usergrant, err := repo.View.UserGrantByIDs(ctxData.OrgID, ctxData.ProjectID, ctxData.UserID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
permissions := make([]string, len(usergrant.RoleKeys))
|
||||
for i, role := range usergrant.RoleKeys {
|
||||
permissions[i] = role
|
||||
}
|
||||
return permissions, nil
|
||||
}
|
||||
|
||||
func (repo *UserGrantRepo) SearchAdminOrgs(request *grant_model.UserGrantSearchRequest) (*grant_model.ProjectOrgSearchResponse, error) {
|
||||
searchRequest := &org_model.OrgSearchRequest{}
|
||||
if len(request.Queries) > 0 {
|
||||
|
Reference in New Issue
Block a user