Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: Application menu displays conversation users and conversation logs --bug=1060818 --user=张展玮 【应用】应用只授权用户查看权限,详情页,没有展示对话用户、对话日志菜单 https://www.tapd.cn/62980211/s/1760973

--bug=1060818 --user=张展玮 【应用】应用只授权用户查看权限,详情页,没有展示对话用户、对话日志菜单 https://www.tapd.cn/62980211/s/1760973
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Aug 25, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Aug 25, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

resource_permission_group_list=[ResourcePermissionConst.APPLICATION_VIEW],
)

APPLICATION_CHAT_LOG_ANNOTATION = Permission(group=Group.APPLICATION_CHAT_LOG, operate=Operate.ANNOTATION,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current code snippet is mostly correct, but here are a few potential improvements:

  1. Consistency in Resource Permissions: The resource_permission_group_list for both application_chat_log_read and application_chat_log_annotation contain [ResourcePermissionConst.APPLICATION_MANGE], which might not be suitable based on how permissions work internally within your application.

  2. Documentation of Group/Operate/Roles: Adding comments to describe the group (e.g., what type of chat log it affects), operate (e.g., read, edit, etc.), and roles should help clarify their purpose.

Here's an updated version with some minor adjustments:

class PermissionConstants(Enum):
    # Define permissions related to application chat users

    APPLICATION_CHAT_USER_READ = Permission(
        group=Group.APPLICATION_CHAT_USER,
        operate=Operate.READ,
        role_list=[RoleConstants.ADMIN, RoleConstants.USER],
        parent_group=[WorkspaceGroup.APPLICATION, UserGroup.APPLICATION],
        resource_permission_group_list=[ResourcePermissionConst.APPLICATION_VIEW],  # Adjusted to view instead of manage
    )

    APPLICATION_CHAT_USER_EDIT = Permission(
        group=Group.APPLICATION_CHAT_USER,
        operate=Operate.EDIT,
        role_list=[RoleConstants.ADMIN, RoleConstants.USER],
        parent_group=[WorkspaceGroup.APPLICATION, UserGroup.APPLICATION],
        resource_permission_group_list=[ResourcePermissionConst.APPLICATION_UPDATE],  # Updated to update if necessary
    )

    # Define permissions related to application chat logs

    APPLICATION_CHAT_LOG_READ = Permission(
        group=Group.APPLICATION_CHAT_LOG,
        operate=Operate.READ,
        role_list=[RoleConstants.ADMIN, RoleConstants.USER],
        parent_group=[WorkspaceGroup.APPLICATION, UserGroup.APPLICATION],
        resource_permission_group_list=[ResourcePermissionConst.APPLICATION_VIEW],  # Adjusted to view instead of manage
    )

    APPLICATION_CHAT_LOG_ANNOTATION = Permission(
        group=Group.APPLICATION_CHAT_LOG,
        operate=Operate.ANNOTATE,
        role_list=[RoleConstants.ADMIN, RoleConstants.USER],
        parent_group=[WorkspaceGroup.APPLICATION, UserGroup.APPLICATION],
        resource_permission_group_list=[ResourcePermissionConst.APPLICATION_COMMENT],  # Adjusted to comment if necessary
    )

Make sure to adjust the resource_permission_group_list according to your actual business logic and permission structure.

@zhanweizhang7 zhanweizhang7 merged commit e28c858 into v2 Aug 25, 2025
3 of 6 checks passed
@zhanweizhang7 zhanweizhang7 deleted the pr@v2@fix_application_displays_conversation_users_and_conversation_logs branch August 25, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants