def only_for(roles):
 if local.flags.in_test:
  return
 if (not isinstance(roles, (tuple, list))):
  roles = (roles,)
 roles = set(roles)
 myroles = set(get_roles())
 if (not roles.intersection(myroles)):
  raise PermissionError

def only_for ( roles ) : if local . flags . in_test : return if ( not isinstance ( roles , ( tuple , list ) ) ) : roles = ( roles , ) roles = set ( roles ) myroles = set ( get_roles ( ) ) if ( not roles . intersection ( myroles ) ) : raise PermissionError
raise frappe .