Switching to project view not working when user is assigned custom Project Role

未关闭
#14,014 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
java
领域
api, authorization

调研方向

使用授予 "allow *" 的自定义 Project Role 重现该故障,然后检查项目视图中对 listApis、listZones 和 listCapabilities 的请求,并将其与 Admin 或 Regular 项目成员身份进行比较。在 API/UI 版本 4.22.1.1 和 4.22.1.0 中检查行为。完成标准是:自定义角色用户可以在没有授权错误的情况下切换到项目视图,并且列出的请求均成功。

由索引模型根据 Issue 内容生成。

描述

component:projects component:UI type:regression
problem

If account/user is added to the project with custom role (even if role permisions are "allow *") user can login to CS successfully but switching to project view will fail and generate multiple errors: "

The given command 'listApis' either does not exist, is not available for user. Unable to proceed. Please contact your administrator." 
The given command 'listZones' either does not exist, is not available for user. Unable to proceed. Please contact your administrator.
The given command 'listCapabilities' either does not exist, is not available for user. Unable to proceed. Please contact your administrator.
...
Image

On browser console indeed you can see that request:
/client/api/?command=listApis&response=json&sessionkey=xxx&projectid=xxx
returns:
{"listapisresponse":{"uuidList":[],"errorcode":401,"cserrorcode":9999,"errortext":"The given command 'listApis' either does not exist, is not available for user."}}
If user is added to the project with Admin or Regular Type without any project role, switching to project view works correctly.

Switching to project view using custom Project Roles in 4.22.1.0 works correctly.
Also using UI ver. 4.22.1.1 and Api ver: 4.22.1.0 works correctly.

No additional logs available in:

cloudstack/management/apilog.log
cloudstack/management/management-server.log
versions

ACS: 4.22.1.1

The steps to reproduce the bug
  1. Create new project "Test"
  2. Create Project Role with "allow *" permission
  3. Add non-admin user to project with that Project Role
  4. Switch to Project View of "Test" project
What to do about it?

Please track the root cause and fix the bug

主要语言
Java
星标
3.1k
派生
1.4k
平均合并
6 天 20 小时
30 天内合并 PR
27

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/cloudstack 的其他 Issue

查看 apache/cloudstack 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。