Fix eslint errors

This commit is contained in:
Dane Everitt 2020-03-29 12:38:08 -07:00
parent ab4c4e7e9e
commit 2e9d327dfc
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -21,9 +21,9 @@ const Can = ({ action, renderOnError, children }: Props) => {
// Allows checking for any permission matching a name, for example files.* // Allows checking for any permission matching a name, for example files.*
// will return if the user has any permission under the file.XYZ namespace. // will return if the user has any permission under the file.XYZ namespace.
( (
permission.endsWith('.*') permission.endsWith('.*') &&
&& permission !== 'websocket.*' permission !== 'websocket.*' &&
&& userPermissions.filter(p => p.startsWith(permission.split('.')[0])).length > 0 userPermissions.filter(p => p.startsWith(permission.split('.')[0])).length > 0
) )
// Otherwise just check if the entire permission exists in the array or not. // Otherwise just check if the entire permission exists in the array or not.
|| userPermissions.indexOf(permission) >= 0); || userPermissions.indexOf(permission) >= 0);