refactor(core): use workspace role query instead of isOwner query (#12118)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Refactor**
  - Updated workspace permission handling to use a unified role field within workspace data instead of separate admin and owner flags.
  - Permission checks now rely on the workspace role for determining admin and owner status.
- **Chores**
  - Removed deprecated queries and types related to admin and owner status.
  - Cleaned up internal logic and variable naming for improved consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
JimmFly
2025-05-13 03:21:22 +00:00
parent 662614de0d
commit cfe7b7cf29
8 changed files with 13 additions and 62 deletions
+1 -25
View File
@@ -3665,18 +3665,6 @@ export type GetInviteInfoQuery = {
};
};
export type GetIsAdminQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
}>;
export type GetIsAdminQuery = { __typename?: 'Query'; isAdmin: boolean };
export type GetIsOwnerQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
}>;
export type GetIsOwnerQuery = { __typename?: 'Query'; isOwner: boolean };
export type GetMemberCountByWorkspaceIdQueryVariables = Exact<{
workspaceId: Scalars['String']['input'];
}>;
@@ -3829,9 +3817,7 @@ export type GetWorkspaceInfoQueryVariables = Exact<{
export type GetWorkspaceInfoQuery = {
__typename?: 'Query';
isAdmin: boolean;
isOwner: boolean;
workspace: { __typename?: 'WorkspaceType'; team: boolean };
workspace: { __typename?: 'WorkspaceType'; role: Permission; team: boolean };
};
export type GetWorkspacePageByIdQueryVariables = Exact<{
@@ -4825,16 +4811,6 @@ export type Queries =
variables: GetInviteInfoQueryVariables;
response: GetInviteInfoQuery;
}
| {
name: 'getIsAdminQuery';
variables: GetIsAdminQueryVariables;
response: GetIsAdminQuery;
}
| {
name: 'getIsOwnerQuery';
variables: GetIsOwnerQueryVariables;
response: GetIsOwnerQuery;
}
| {
name: 'getMemberCountByWorkspaceIdQuery';
variables: GetMemberCountByWorkspaceIdQueryVariables;