(display)
| 32 | } |
| 33 | |
| 34 | const hasDisplay = (display) => { |
| 35 | if (!display) { |
| 36 | return true |
| 37 | } |
| 38 | |
| 39 | // if it has display flag, but user has no features, then it should not be displayed |
| 40 | if (!features || Array.isArray(features) || Object.keys(features).length === 0) { |
| 41 | return false |
| 42 | } |
| 43 | |
| 44 | // check if the display flag is in the features |
| 45 | if (Object.hasOwnProperty.call(features, display)) { |
| 46 | const flag = features[display] === 'true' || features[display] === true |
| 47 | return flag |
| 48 | } |
| 49 | |
| 50 | return false |
| 51 | } |
| 52 | |
| 53 | return { hasPermission, hasAssignedWorkspace, hasDisplay } |
| 54 | } |
no test coverage detected