Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
MrFlashAccount committed Jan 7, 2025
1 parent 2931659 commit 768c40d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/common/src/services/Backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ export interface UserPermission {

/** User permission for a specific user group. */
export interface UserGroupPermission {
readonly userGroup: UserGroupInfo
readonly userGroup: UserGroup
readonly permission: permissions.PermissionAction
}

Expand Down Expand Up @@ -560,7 +560,7 @@ export function isUserGroupPermissionAnd(predicate: (permission: UserGroupPermis

/** Get the property representing the name on an arbitrary variant of {@link UserPermission}. */
export function getAssetPermissionName(permission: AssetPermission) {
return isUserPermission(permission) ? permission.user.name : permission.userGroup.groupName
return isUserPermission(permission) ? permission.user.name : permission.userGroup.name
}

/** Get the property representing the id on an arbitrary variant of {@link UserPermission}. */
Expand Down Expand Up @@ -1174,8 +1174,8 @@ export function compareAssetPermissions(a: AssetPermission, b: AssetPermission)
} else {
// NOTE [NP]: Although `userId` is unique, and therefore sufficient to sort permissions, sort
// name first, so that it's easier to find a permission in a long list (i.e., for readability).
const aName = 'user' in a ? a.user.name : a.userGroup.groupName
const bName = 'user' in b ? b.user.name : b.userGroup.groupName
const aName = 'user' in a ? a.user.name : a.userGroup.name
const bName = 'user' in b ? b.user.name : b.userGroup.name
const aUserId = 'user' in a ? a.user.userId : a.userGroup.id
const bUserId = 'user' in b ? b.user.userId : b.userGroup.id
return (
Expand Down
2 changes: 1 addition & 1 deletion app/gui/src/dashboard/utilities/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function tryCreateOwnerPermission(
category: Category,
user: backend.User,
users: readonly backend.User[],
userGroups: readonly backend.UserGroupInfo[],
userGroups: readonly backend.UserGroup[],
): readonly backend.AssetPermission[] {
switch (category.type) {
case 'team': {
Expand Down

0 comments on commit 768c40d

Please sign in to comment.