Skip to content

Commit

Permalink
#323 - Removed unnecessary eslint exception (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
west270 authored Jan 9, 2023
1 parent dd73838 commit 0c36ac9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/containers/PermissionsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ const usePermissions = () => {
}
return (
globalPerms?.includes(permission) ||
// eslint-disable-next-line no-prototype-builtins
!!domainPerms?.hasOwnProperty(permission)
Object.prototype.hasOwnProperty.call(domainPerms, permission)
)
}

Expand All @@ -110,8 +109,11 @@ const usePermissions = () => {
if (globalPerms?.includes(permission)) {
return true
}
// eslint-disable-next-line no-prototype-builtins
if (garden.id && domainPerms?.hasOwnProperty(permission)) {
if (
garden.id &&
domainPerms &&
Object.prototype.hasOwnProperty.call(domainPerms, permission)
) {
return domainPerms[permission].garden_ids.includes(garden.id)
}
return false
Expand All @@ -134,8 +136,10 @@ const usePermissions = () => {
if (garden && hasGardenPermission(permission, garden)) {
return true
}
// eslint-disable-next-line no-prototype-builtins
if (domainPerms?.hasOwnProperty(permission)) {
if (
domainPerms &&
Object.prototype.hasOwnProperty.call(domainPerms, permission)
) {
return domainPerms[permission].system_ids.includes(systemId)
}
return false
Expand Down

0 comments on commit 0c36ac9

Please sign in to comment.