import { BasePermissions } from "gd-sprest-def/lib/SP/complextypes" ; import { IhasPermissions } from "../../../@types/helper/methods" ; declare var SP ; /**
 * Determines if the user has permissions, based on the permission kind value
 */ export const hasPermissions = ( permissionMask , permissions = [ ] ) : boolean => { let requestedPermissions = typeof ( permissions ) === "number" ? [ permissions ] : permissions ; let hasPermissions = true ; if ( ( ( permissionMask . High & 32767 ) == 32767 ) && ( ( permissionMask . Low & 65535 ) == 65535 ) ) { return hasPermissions ; } for ( let i = 0 ; i < requestedPermissions . length ; i ++ ) { let permission = requestedPermissions [ i ] ; let sequence = permissionMask . Low ; if ( permission >= 32 ) { sequence = permissionMask . High ; permission -= 32 ; } if ( ( sequence & ( 1 << ( permission - 1 ) ) ) == 0 ) { hasPermissions = false ; break ; } } return hasPermissions ; } ;